Skip to content

Migrate to Java 25#82

Draft
patrick-vuong with Copilot wants to merge 3 commits into
mainfrom
copilot/migrate-java-25
Draft

Migrate to Java 25#82
patrick-vuong with Copilot wants to merge 3 commits into
mainfrom
copilot/migrate-java-25

Conversation

Copilot AI commented May 19, 2026

Copy link
Copy Markdown
Contributor

Migrate project from Java 11 to Java 25 using OpenRewrite's UpgradeToJava25 recipe.

Build & CI

  • Compiler target/release 11 → 25, maven-compiler-plugin 3.11.0 → 3.15.0
  • Surefire/Failsafe 3.2.2 → 3.5.5 with --add-opens args for module encapsulation
  • CI workflow JDK 11 → 25

Code modernization

  • Pattern matching instanceof — eliminates redundant casts
  • Switch expressions — arrow syntax replacing verbose switch/case/break
  • Unnamed variablescatch (IllegalArgumentException _) where exception is unused
  • String.formatted() — replaces String.format()
  • Flexible mainvoid main(String[]) instead of public static void main(String[])
// 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();
}

This change was produced with Moderne CLI and Moderne Agent Tools (MCP).

Copilot AI linked an issue May 19, 2026 that may be closed by this pull request
Copilot AI and others added 2 commits May 19, 2026 20:01
Agent-Logs-Url: https://github.com/moderneinc/yet-another-dropwizard-service/sessions/a0f88305-a41d-46f0-a34e-7c524efda404

Co-authored-by: patrick-vuong <107423518+patrick-vuong@users.noreply.github.com>
Applied org.openrewrite.java.migrate.UpgradeToJava25 recipe which:
- Updates Maven compiler settings from Java 11 to 25
- Upgrades maven-compiler-plugin 3.11.0 -> 3.15.0
- Upgrades maven-surefire/failsafe-plugin 3.2.2 -> 3.5.5
- Adds --add-opens JVM args for test plugins
- Updates CI workflow to use JDK 25
- Converts instanceof-then-cast to pattern matching
- Converts traditional switch to switch expressions
- Uses unnamed catch variables (_) where exception is unused
- Uses String.formatted() instead of String.format()
- Uses flexible main method (void main instead of public static void main)

This change was produced with Moderne CLI and Moderne Agent Tools (MCP).
MCP was unavailable for part of this work; Moderne CLI fallback was used.

Agent-Logs-Url: https://github.com/moderneinc/yet-another-dropwizard-service/sessions/a0f88305-a41d-46f0-a34e-7c524efda404

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 19, 2026
Copilot AI requested a review from patrick-vuong May 19, 2026 20:06
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