Skip to content

Migrate to Java 25#66

Draft
patrick-vuong with Copilot wants to merge 2 commits into
mainfrom
copilot/migrate-to-java-25-3837a7a5-5da3-4894-a26e-eba4dad2c07a
Draft

Migrate to Java 25#66
patrick-vuong with Copilot wants to merge 2 commits into
mainfrom
copilot/migrate-to-java-25-3837a7a5-5da3-4894-a26e-eba4dad2c07a

Conversation

Copilot AI commented May 12, 2026

Copy link
Copy Markdown
Contributor

Migrate from Java 11 to Java 25 using OpenRewrite's UpgradeToJava25 recipe, covering build tooling, CI, and source-level modernization.

Build & CI

  • maven.compiler.release25, drop redundant maven.compiler.source
  • maven-compiler-plugin 3.11.0 → 3.15.0
  • maven-surefire-plugin / maven-failsafe-plugin 3.2.2 → 3.5.5 with --add-opens for reflective access
  • CI workflow: JDK 11 → 25 (Temurin)

Source modernization

  • Pattern matching for instanceof instead of cast-after-check
  • Switch expressions replacing verbose switch statements
  • Unnamed catch variables (_) where the exception is unused
  • String.formatted() over String.format()
// Before
if (event instanceof Wizard) {
    Wizard w = (Wizard) event;
    return "Wizard registration: " + w.getFirstName();
}

// After
if (event instanceof Wizard w) {
    return "Wizard registration: " + w.getFirstName();
}

Note: Reverted the recipe's conversion of public static void main → instance void main — Dropwizard's Application subclass and the shade plugin's mainClass config require the traditional entry point.

Copilot AI linked an issue May 12, 2026 that may be closed by this pull request
- Update maven.compiler.release/source/target to 25
- Upgrade maven-compiler-plugin to 3.15.0
- Upgrade maven-surefire-plugin and maven-failsafe-plugin to 3.5.5
- Add --add-opens JVM args for test plugins
- Update CI workflow to use JDK 25
- Modernize Java code: pattern matching instanceof, switch expressions,
  unnamed catch variables, String.formatted()

Agent-Logs-Url: https://github.com/moderneinc/yet-another-dropwizard-service/sessions/9fdf9a31-f18f-48b5-8630-b4416581911e

Co-authored-by: patrick-vuong <107423518+patrick-vuong@users.noreply.github.com>
Copilot AI changed the title [WIP] Migrate project to Java 25 Migrate to Java 25 May 12, 2026
Copilot AI requested a review from patrick-vuong May 12, 2026 14:38
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.

Migrate Java 25

2 participants