Skip to content

Upgrade from Java 6 to Java 11#22

Open
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin/1775204638-java11-upgrade
Open

Upgrade from Java 6 to Java 11#22
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin/1775204638-java11-upgrade

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot commented Apr 3, 2026

Summary

Upgrades the DropwizardEmployee project from Java 6 to Java 11. This involves a major Dropwizard framework upgrade (1.0.5 → 2.1.12) since Dropwizard 1.x does not support Java 11, along with build plugin updates and source code fixes for API changes.

Build changes (pom.xml):

  • Decoupled Dropwizard BOM version from ${project.version}, pinned to 2.1.12
  • Added dropwizard-dependencies BOM for transitive dependency management
  • Compiler target: <source>1.6</source>/<target>1.6</target><release>11</release>
  • maven-compiler-plugin 3.6.0 → 3.13.0, maven-surefire-plugin 2.19.1 → 3.2.5, maven-shade-plugin 2.4.3 → 3.6.0
  • Added module-info.class exclusion in shade plugin filters (required for Java 9+ uber-JARs)
  • Added explicit junit:junit:4.13.2 and junit-vintage-engine:5.9.3 test dependencies

Source changes:

  • EmployeeConfiguration.java: Migrated @NotEmpty from org.hibernate.validator.constraintsjavax.validation.constraints (deprecated in Hibernate Validator 6.x)
  • EmployeeDAO.java: Added cast to Query<Employee> for namedQuery() return type (Hibernate 5.x API change)
  • AppTest.java: Migrated from JUnit 3 (extends TestCase) to JUnit 4 (@Test annotation)

Validated with Java 11: mvn clean verify passes — zero compilation errors, 1 test passes.

Review & Testing Checklist for Human

  • Runtime smoke test: Start the app with java -jar target/DropwizardEmployee-1.0.5.jar server example.yml under Java 11 and verify POST /employee and GET /employee endpoints work. The test suite is minimal (one trivial assertion) and does not exercise the actual application.
  • Dropwizard 1.x → 2.x behavioral changes: This is a major framework jump that upgrades Hibernate (4→5), Jetty, Jersey, Jackson, and other transitive deps. Review Dropwizard 2.0 migration guide for any breaking changes relevant to this app's usage patterns (Hibernate bundle, migrations bundle, views bundle).
  • Unchecked cast in EmployeeDAO.findAll(): The @SuppressWarnings("unchecked") cast from Query<?> to Query<Employee> is safe for this specific named query but verify it doesn't mask issues.

Notes

  • The existing test (AppTest.testApp) only asserts assertTrue(true) — it provides no meaningful coverage of application behavior. Consider adding integration tests.
  • Shade plugin warnings about overlapping resources in JARs are benign (common with uber-JARs containing multiple Jersey/Jackson modules).

Link to Devin session: https://app.devin.ai/sessions/3ca980d7adbf4f53a924072bb929b7e6
Requested by: @wavecreator1


Open with Devin

- Upgrade Dropwizard from 1.0.5 to 2.1.12 (decouple BOM from project version)
- Add dropwizard-dependencies BOM for transitive dependency management
- Update maven-compiler-plugin to 3.13.0 with <release>11</release>
- Update maven-surefire-plugin to 3.2.5
- Update maven-shade-plugin to 3.6.0 with module-info.class exclusion
- Migrate @notempty import from org.hibernate.validator.constraints to javax.validation.constraints
- Fix EmployeeDAO.findAll() typing for Hibernate 5.x Query API
- Migrate test from JUnit 3 to JUnit 4 with vintage engine for surefire 3.x
- Add explicit junit 4.13.2 and junit-vintage-engine 5.9.3 test dependencies

Co-Authored-By: Siddhant Seghal <siddxs5@gmail.com>
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Copy Markdown
Author

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

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.

0 participants