Skip to content

Upgrade Java 6 to Java 11 (AB-187)#29

Open
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin/1775692145-upgrade-java-6-to-11
Open

Upgrade Java 6 to Java 11 (AB-187)#29
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin/1775692145-upgrade-java-6-to-11

Conversation

@devin-ai-integration
Copy link
Copy Markdown

Summary

Upgrades the DropwizardEmployee project from Java 6 to Java 11. This required a major Dropwizard framework upgrade (1.0.5 → 2.1.12) since Dropwizard 1.x does not support Java 11.

Build changes (pom.xml):

  • Decoupled Dropwizard BOM version from ${project.version} — pinned to 2.1.12
  • Added dropwizard-dependencies BOM import for transitive dependency management
  • maven-compiler-plugin 3.6.0 → 3.13.0, switched <source>/<target> 1.6 to <release>11</release>
  • maven-surefire-plugin 2.19.1 → 3.2.5
  • maven-shade-plugin 2.4.3 → 3.6.0, added module-info.class exclusion for Java 9+ uber-JAR compatibility

Source changes:

  • EmployeeConfiguration.java: @NotEmpty import moved from deprecated org.hibernate.validator.constraints to standard javax.validation.constraints
  • EmployeeDAO.java: Added explicit cast of namedQuery() result to Query<Employee> to satisfy Hibernate 5.x generics in AbstractDAO.list()
  • AppTest.java: Migrated from JUnit 3 (junit.framework.TestCase) to JUnit 5 (org.junit.jupiter.api)

mvn clean verify passes (compilation + tests + shaded JAR packaging).

Review & Testing Checklist for Human

  • Runtime smoke test: Start the app with java -jar target/DropwizardEmployee-1.0.5.jar server example.yml and hit GET /employee and POST /employee — the existing test only asserts assertTrue(true) and does not exercise any real functionality
  • Dropwizard 1.x → 2.x behavioral changes: This is a major framework jump. Verify Hibernate 5.x session/transaction behavior, Jetty 9.4.x connector config, and Jersey 2.41 resource registration all work correctly at runtime with the existing example.yml
  • EmployeeDAO unchecked cast (EmployeeDAO.java:26): The @SuppressWarnings("unchecked") cast from Query<?> to Query<Employee> is safe for this named query, but confirm this pattern is acceptable going forward

Notes

  • The original pom.xml tied Dropwizard's BOM version to ${project.version} (1.0.5), which coincidentally matched Dropwizard 1.0.5. This coupling has been removed.
  • Test coverage is minimal — the only test is a no-op assertTrue(true). Runtime verification is strongly recommended.

Link to Devin session: https://app.devin.ai/sessions/19fe50cd192b4073a1fb9f0270d76e31
Requested by: @pqn

- Update Dropwizard BOM from 1.0.5 to 2.1.12 (decoupled from project version)
- Add dropwizard-dependencies BOM import
- Update maven-compiler-plugin to 3.13.0, use <release>11</release>
- Update maven-surefire-plugin to 3.2.5
- Update maven-shade-plugin to 3.6.0, add module-info.class exclusion
- Fix @notempty import: org.hibernate.validator.constraints -> javax.validation.constraints
- Fix EmployeeDAO.findAll() typing for Hibernate 5.x Query generics
- Migrate test from JUnit 3 (junit.framework) to JUnit 5 (Jupiter)

Co-Authored-By: prem@cognition.ai <prem@cognition.ai>
@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

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.

1 participant