Skip to content

Lower the supported Java floor to 17 (test on JDK 17/21/25) - #4

Merged
fprochazka merged 2 commits into
masterfrom
fp/jdk-17-floor
Jul 7, 2026
Merged

Lower the supported Java floor to 17 (test on JDK 17/21/25)#4
fprochazka merged 2 commits into
masterfrom
fp/jdk-17-floor

Conversation

@fprochazka

Copy link
Copy Markdown
Member

What & why

Lowers the supported Java floor from 21 to 17. The published bytecode is now compiled --release 17, so the library can be consumed on any JDK 17+ runtime rather than requiring 21+. The compile toolchain (framefork { jdkVersion }) stays at 21.

The CI test matrix moves from [21, 22, 23] to the current LTS set [17, 21, 25], dropping the now-EOL 22/23 and adding 17 (the new floor) and 25 (current LTS). The compile/daemon JDK pinned in setup-java stays at 21 because the org.framefork.build convention plugin still needs a 21+ runtime to resolve on the buildscript classpath.

Source changes

The branch is shaped as two commits, source-compat first so every commit builds:

  1. refactor: — avoid the handful of Java 21 idioms so the source compiles on Java 17 (semantics unchanged).
  2. build: — drop minJavaVersion to 17 and retarget the CI matrix.

Java 21 idioms unrolled to Java 17 equivalents:

  • List.getFirst() (Java 21 SequencedCollection) -> List.get(0) in PropertySourcesOverridePrecedencePostProcessor; identical result, the list is already known non-empty at that point.

Verification

Run locally in a worktree with JDK 17/21/25 available via SDKMAN:

  • ./gradlew clean build — green: compiles --release 17, Error Prone / NullAway / doclint all pass.
  • ./gradlew build -Ptests.jdk.version=17 --rerun-tasks — green: tests genuinely execute on a JDK 17 launcher.
  • javap -v on a compiled main-module class reports major version 61 (Java 17 bytecode).

Replace the SequencedCollection `List.getFirst()` (Java 21) with the
equivalent `List.get(0)` so the source compiles on Java 17. Behavior is
identical: both return the first element of the resource property sources.
Drop `minJavaVersion` from 21 to 17 so the published bytecode is compiled
`--release 17`, broadening the range of consumers that can use the library.
The compile toolchain (`jdkVersion`) stays at 21.

Align the CI matrix to the current LTS set [17, 21, 25], dropping the
now-EOL 22/23. The compile/daemon JDK pinned in setup-java stays at 21, as
the org.framefork.build plugin still requires a 21+ runtime to resolve.
@fprochazka
fprochazka merged commit b73052a into master Jul 7, 2026
4 checks passed
@fprochazka
fprochazka deleted the fp/jdk-17-floor branch July 7, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant