Skip to content

Upgrade from Java 6 to Java 11#21

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

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

Conversation

@devin-ai-integration
Copy link
Copy Markdown

Summary

Upgrades the DropwizardEmployee application from Java 6 to Java 11, including a major Dropwizard framework bump from 1.0.5 to 2.1.12 and associated dependency/plugin updates.

Build changes (pom.xml):

  • Decoupled Dropwizard BOM version from ${project.version} → pinned to 2.1.12; added dropwizard-dependencies BOM
  • Compiler: <source>1.6</source>/<target>1.6</target><release>11</release> (plugin 3.6.0 → 3.13.0)
  • Surefire: 2.19.1 → 3.2.5
  • Shade: 2.4.3 → 3.6.0, added module-info.class exclusion for Java 9+ uber-JAR compatibility
  • Added explicit junit:junit:4.13.2 + junit-vintage-engine:5.10.1 (needed because surefire 3.x uses JUnit Platform, and the existing test extends JUnit 3 TestCase)

Source changes:

  • EmployeeConfiguration.java: @NotEmpty import moved from deprecated org.hibernate.validator.constraintsjavax.validation.constraints
  • EmployeeDAO.java: Added unchecked cast of namedQuery() result to Query<Employee> to satisfy Hibernate 5.x/Dropwizard 2.x stricter generics on AbstractDAO.list()

Validation: mvn clean verify passes — zero compilation errors, 1/1 tests pass.

Review & Testing Checklist for Human

  • Runtime smoke test: Start the app with java -jar target/DropwizardEmployee-1.0.5.jar server example.yml and verify POST /employee and GET /employee work correctly. The existing test suite is only assertTrue(true) — it provides no real coverage of application behavior after this major framework bump.
  • Dropwizard 1.x → 2.x behavioral changes: Review whether any Dropwizard 2.x breaking changes affect this app's configuration or runtime (e.g., Hibernate 5.x session handling, Jersey 2.41 behavior, Jetty 9.4.x defaults). The Dropwizard 2.0 migration guide is relevant.
  • EmployeeDAO unchecked cast: The @SuppressWarnings("unchecked") cast on the namedQuery() result is safe for this specific query but suppresses type-safety checks — verify no other DAO patterns are planned that could be affected.

Notes

  • The Dropwizard version jump (1.0.5 → 2.1.12) transitively upgrades Hibernate (4.x → 5.6.x), Jetty (9.3.x → 9.4.x), Jackson (2.7.x → 2.13.x), and Jersey (2.22.x → 2.41). All of these are compatible with Java 11.
  • The shade plugin warnings about overlapping resources in the uber-JAR are benign (duplicate LICENSE/NOTICE files from different JARs).

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

- Upgrade Dropwizard BOM from 1.0.5 to 2.1.12, add dropwizard-dependencies BOM
- Update maven-compiler-plugin to 3.13.0 with <release>11</release>
- Update maven-surefire-plugin from 2.19.1 to 3.2.5
- Update maven-shade-plugin from 2.4.3 to 3.6.0 with module-info.class exclusion
- Add explicit JUnit 4.13.2 and junit-vintage-engine 5.10.1 for test compatibility
- Fix @notempty import: org.hibernate.validator.constraints -> javax.validation.constraints
- Fix EmployeeDAO.findAll() typing for Hibernate 5.x Query<Employee> compatibility

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

@devin-ai-integration
Copy link
Copy Markdown
Author

End-to-End Test Results — Java 6 → 11 Upgrade

Built and ran the upgraded app locally (Dropwizard 2.1.12, Java 11 bytecode on Java 21 runtime). All tests passed.

Test Results

Test Result
GET /employee returns empty array initially PASSED
POST /employee creates employee with correct JSON response PASSED
GET /employee returns persisted employee after POST PASSED
Admin Operational Menu loads on port 8081 PASSED
Healthcheck (deadlocks + hibernate) reports healthy PASSED

Build Validation

  • mvn clean verifyPASSED (0 compilation errors, 1/1 unit tests pass)
  • Liquibase DB migration — PASSED
  • Server startup — PASSED (no ClassNotFoundException or Java 11 incompatibility errors)
Screenshots
GET /employee (empty) GET /employee (after POST)
Empty With employee
Admin Menu Healthcheck
Admin Healthcheck
CI Notes

Two non-required Snyk checks (security/license) failed — external dependency scans, not blocking merge.

Devin session

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