Skip to content

8/migrate to java 17#12

Closed
jottinger wants to merge 2 commits intoDemchaAV:mainfrom
jottinger:8/migrate-to-java-17
Closed

8/migrate to java 17#12
jottinger wants to merge 2 commits intoDemchaAV:mainfrom
jottinger:8/migrate-to-java-17

Conversation

@jottinger
Copy link
Copy Markdown
Contributor

Fixes #8
Includes base branch from #10

Note that benchmarks has NOT been fully tested.

jottinger added 2 commits May 8, 2026 16:31
* Main focus is on bytebuddy, BUT
* Also updates other dependencies to update CVE issues
* Does not fully address submodules, as they're out of scope and should be backwards compatible anyway
* Migrates pattern-matched switch to alternatives
* Migrates new List access methods to alternatives
* Changes PreviewCompiler in src/test/java to use Maven-specified compiler version
@DemchaAV
Copy link
Copy Markdown
Owner

DemchaAV commented May 9, 2026

Hi @jottinger — same note as on #11: this work is consolidated into PR #14 (feature/java-17-baseline). Your three commits (incl. af1f82af "Updates code to conform to java 17") are at the bottom of #14 with original authorship preserved. Closing in favour of #14.

The remaining gaps your PR called out as out-of-scope (submodules) are addressed by the follow-up commit on #14:

  • examples/pom.xml <maven.compiler.release> 21 → 17
  • examples/.../WeeklyScheduleRenderer.java — two switch-with-deconstruction blocks rewritten as instanceof if-else chains
  • benchmarks/.../BenchmarkMedianTool.java — 9× List.getFirst().get(0)
  • benchmarks/.../ComparativeBenchmark.java — 2× Thread.threadId()getId()

CI on Temurin 17 (PR #14): 785 / 0 / 0 / 0. Thanks for the clean migration.

@DemchaAV
Copy link
Copy Markdown
Owner

DemchaAV commented May 9, 2026

Consolidated into #14. Thank you.

@DemchaAV DemchaAV closed this May 9, 2026
DemchaAV added a commit that referenced this pull request May 9, 2026
* Updates module dependencies

* Main focus is on bytebuddy, BUT
* Also updates other dependencies to update CVE issues

* Updating benchmarks dependencies for CI/CD

* Updates code to conform to java 17

* Does not fully address submodules, as they're out of scope and should be backwards compatible anyway
* Migrates pattern-matched switch to alternatives
* Migrates new List access methods to alternatives
* Changes PreviewCompiler in src/test/java to use Maven-specified compiler version

* v1.7 prep: complete the Java 17 baseline migration

Builds on @jottinger's three commits cherry-picked above:

- 5b7d6d4 Updates module dependencies        (=#11 base)
- 2e32eb5 Updating benchmarks dependencies   (=#11 follow-up)
- af1f82a Updates code to conform to java 17 (=#12)

Follow-up gaps closed by this commit:

- examples/pom.xml — flip <maven.compiler.release> 21 → 17 (only
  the root and benchmarks POMs were flipped upstream).
- examples/.../WeeklyScheduleRenderer.java — rewrite the two
  switch-with-deconstruction blocks (DayShift / Half) plus the
  StatusFill instanceof-with-record-pattern check as Java
  17–compatible instanceof if-else chains. Records still expose
  status() / shift() / lunch() / dinner() so call sites are a
  one-line refactor each.
- benchmarks/.../BenchmarkMedianTool.java — 9× List.getFirst() →
  .get(0) (List.getFirst is JEP 431, Java 21).
- benchmarks/.../ComparativeBenchmark.java — Thread.threadId() →
  Thread.getId() (threadId is Java 19+).
- .github/workflows/ci.yml — actions/setup-java java-version
  '21' → '17' across all five jobs.
- README.md — Java-21 badge → Java-17+.
- CHANGELOG.md — new "## v1.7.0 — Planned" entry detailing the
  Java 17 baseline, dependency refresh, and Maven Central
  distribution plan; credits @jottinger upfront.

Local verification on this worktree:

- ./mvnw -B -ntp clean verify -pl . → 785 / 0 / 0 / 0
- ./mvnw -B -ntp -f examples/pom.xml clean compile → BUILD SUCCESS
- ./mvnw -B -ntp -f benchmarks/pom.xml clean compile → BUILD SUCCESS

Note: local Maven runs on Java 21 with -release 17, which catches
compile-time API drift but not runtime-only Java 21 hooks. The
draft PR's CI run on Temurin JDK 17 is the truth source for that.

Co-Authored-By: Joseph Ottinger <joeo@enigmastation.com>

* ci: run on PRs to any base + on develop pushes (so v1.7 prep PR triggers)

* docs(changelog): reframe Java 17 baseline as v1.6.1 (patch), not v1.7

SemVer-correct framing: this PR adds no public API, doesn't break
v1.6.0 callers, and is mostly compatibility expansion + dependency
hygiene. That's a patch, not a minor. Maven Central distribution
(the only true minor-level change in the prior framing) stays
queued for the actual v1.7.0 alongside the JMH migration.

* ci: matrix Build+test across JDK 17 / 21 / 25

Each push and PR now runs the full canonical test suite (~819
tests, mvnw verify) against three JDKs in parallel:

  - JDK 17 — the baseline target (compiler.release=17). Lowest
    common denominator; what enterprise stacks deploy on.
  - JDK 21 — the previous baseline. Validates that bytecode-17
    still runs cleanly on the post-Java-21 sequenced-collections
    JVM after the getFirst()/getLast()/threadId() rewrites.
  - JDK 25 — the current LTS. Validates the byte-buddy 1.18.7 +
    mockito 5.23 dependency bumps that #10 motivated; without
    those, mockito breaks on the JDK 25 access rules.

fail-fast: false so a regression on one JDK doesn't mask the
status of the others. Javadoc generation runs only on JDK 17 —
its output is JVM-independent, no need to triple-bake.

The other jobs (Architecture+Documentation Guards, Examples
Generation Smoke Test, Performance Smoke Check, Weekly Benchmark
Diff) stay single-JDK on 17 — they're fast enough that adding
parallel JDKs adds no signal, and benchmark numbers across JVMs
would be noisy comparisons rather than a regression gate.

---------

Co-authored-by: Joseph Ottinger <joeo@enigmastation.com>
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.

Backmigrate to Java 17

2 participants