Skip to content

Commit d59a573

Browse files
committed
docs: align CLAUDE.md with dual Java 8/11+ target
The build now ships as a Java 8 artifact (JDK 8 is the source of truth, CI builds/tests/releases on it) while still compiling on JDK 11+. Update the project guidance to describe the dual-target profiles and the Java 8 language/API floor, and list the newer-than-8 features that are off-limits (var, List.of/copyOf, String.repeat, ProcessHandle, Thread.onSpinWait, the Java 9 Provider(String,String,String) ctor, enhanced switch, text blocks, instanceof pattern vars).
1 parent c851317 commit d59a573

1 file changed

Lines changed: 30 additions & 4 deletions

File tree

CLAUDE.md

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,30 @@ Guidance for Claude Code when working with the QuestDB Java client
77

88
The standalone client repo for QuestDB ingestion (legacy ILP and QWP). It is
99
a Git submodule of the `questdb` repository and ships as the
10-
`io.questdb:questdb-client` Maven artifact. The module targets Java 11, so
11-
only legacy Java features are available here — no enhanced switch, no
12-
multiline strings, no pattern variables in `instanceof`.
10+
`io.questdb:questdb-client` Maven artifact.
11+
12+
**Dual JDK target — always aim at both.** The client ships as a Java 8
13+
artifact (JDK 8 is the source of truth: CI builds, tests, and releases on
14+
JDK 8) but must also compile cleanly on JDK 11+ (CI runs a JDK 25
15+
compile/javadoc smoke job). The right Maven profile (`java8` /
16+
`java11+`) auto-activates from the running JDK; a `src/main/java8` vs
17+
`src/main/java11` source root supplies the per-JDK shims. Practically this
18+
means **Java 8 is the language/API floor** — every change must build on
19+
both, so write to Java 8 and never introduce an API or syntax that only a
20+
newer JDK has.
21+
22+
Disallowed here (newer than Java 8), among others:
23+
- `var` local-variable type inference (10), enhanced `switch` (14),
24+
multiline text blocks (15), pattern variables in `instanceof` (16)
25+
- `List.of` / `List.copyOf` / `Map.of` and friends (9/10),
26+
`String.repeat` / `String.strip` / `String.isBlank` (11)
27+
- `ProcessHandle` (9), `Thread.onSpinWait` (9),
28+
the `Provider(String, String, String)` ctor (9 — use the Java 8
29+
`Provider(String, double, String)` overload)
30+
31+
When in doubt, check the API's `@since` and keep it `<= 1.8`. JDK
32+
9+-only behaviour belongs behind the `src/main/java11` shim with a Java 8
33+
counterpart in `src/main/java8`.
1334

1435
## Git & PR Conventions
1536

@@ -35,13 +56,18 @@ multiline strings, no pattern variables in `instanceof`.
3556

3657
## Build
3758

38-
Standard Maven build. Targets Java 11:
59+
Standard Maven build. Dual-target (Java 8 floor, Java 11+ also supported);
60+
the `java8` / `java11+` profile auto-activates from the JDK running Maven:
3961

4062
```bash
4163
mvn clean install -DskipTests # build + install to local Maven cache
4264
mvn -pl core test # run client unit tests
4365
```
4466

67+
Build on a JDK 8 to validate the shipping artifact (the source-of-truth
68+
target); also confirm it compiles on a modern JDK (11+) before merging, the
69+
same two fronts CI guards.
70+
4571
The parent `questdb` repo's `local-client` profile pulls this module as a
4672
sub-module so server changes can build against unpublished client code; if
4773
you change client code, install it (or pass `-P local-client` in the parent)

0 commit comments

Comments
 (0)