modernize: upgrade to Java 17, Dropwizard 4.0.9, and apply code quality recipes#109
Open
PaulaPaul wants to merge 1 commit into
Open
modernize: upgrade to Java 17, Dropwizard 4.0.9, and apply code quality recipes#109PaulaPaul wants to merge 1 commit into
PaulaPaul wants to merge 1 commit into
Conversation
…ty recipes Based on Moderne Prethink context (dependencies, test gaps, project identity): ## Changes applied via OpenRewrite/Moderne recipes ### Java 17 Migration (org.openrewrite.java.migrate.UpgradeToJava17) - Bump maven.compiler.source/target/release from 11 → 17 - Upgrade maven-compiler-plugin 3.11.0 → 3.15.0 - Apply instanceof pattern matching in WizardService.describeRegistrationEvent() (e.g. `if (event instanceof Wizard w)` instead of cast) - Update CI workflow to use JDK 17 ### Text Blocks (org.openrewrite.java.migrate.lang.UseTextBlocks) - Convert multi-line SQL string concatenation in WizardDAO to text blocks (createTable, insert, and update queries are now far more readable) ### Common Static Analysis (org.openrewrite.staticanalysis.CommonStaticAnalysis) - Sort imports to canonical order (jakarta.*, java.*, then 3rd-party) - Remove unused imports (ConfigurationException, IOException in tests) - Replace wildcard Mockito import with explicit imports in WizardServiceTest ### Dependency Vulnerability Fixes (org.openrewrite.java.dependencies.DependencyVulnerabilityCheck) - Upgrade Dropwizard 4.0.2 → 4.0.9 (patches security CVEs) - Remove pinned h2.version property (now managed by Dropwizard BOM) ### JUnit 5 Best Practices (org.openrewrite.java.testing.junit5.JUnit5BestPractices) - Remove 'test' prefix from test method names per JUnit 5 convention (e.g. testSupportAccessible → supportAccessible in IT tests) - Remove redundant exception declarations from test method signatures ### Maven Best Practices (org.openrewrite.maven.BestPractices) - Sort dependency declarations alphabetically within groups All 22 tests pass after modernization (11 unit + 11 integration tests). This change was produced with Moderne CLI and Moderne Agent Tools (MCP), informed by Moderne Prethink context (dependencies, test gaps, project identity). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR modernizes the Wizard Registry Dropwizard 4 service, applying automated Java and dependency upgrades via Moderne CLI and OpenRewrite recipes.
Based on Moderne Prethink context (dependencies, test gaps, project identity), the following areas were identified as high priority:
Recipes Applied
1.
org.openrewrite.java.migrate.UpgradeToJava17maven.compiler.source/target/releasefrom 11 → 17maven-compiler-plugin3.11.0 → 3.15.0WizardService.describeRegistrationEvent()2.
org.openrewrite.java.migrate.lang.UseTextBlocksWizardDAOto Java 15 text blocks3.
org.openrewrite.staticanalysis.CommonStaticAnalysisConfigurationException,IOExceptionin tests)WizardServiceTest4.
org.openrewrite.java.dependencies.DependencyVulnerabilityCheckh2.versionproperty (now managed by Dropwizard BOM)5.
org.openrewrite.java.testing.junit5.JUnit5BestPracticestestprefix from test method names per JUnit 5 convention6.
org.openrewrite.maven.BestPracticesTest Results
All 22 tests pass after modernization:
Prethink Risk Analysis
The top-risk untested methods (from
test-gaps.csv) were considered but these recipes focus on automated safe transformations only — the application logic is unchanged.This change was produced with Moderne CLI and Moderne Agent Tools (MCP), informed by Moderne Prethink context (dependencies, test gaps, project identity).
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com