Skip to content

Upgrade Java 17/8 references to Java 21#18

Open
dillonvargo wants to merge 1 commit into
masterfrom
devin/1771605893-upgrade-java-21-refs
Open

Upgrade Java 17/8 references to Java 21#18
dillonvargo wants to merge 1 commit into
masterfrom
devin/1771605893-upgrade-java-21-refs

Conversation

@dillonvargo

Copy link
Copy Markdown
Owner

Description of what I changed

Updated all outdated Java version references to reflect that Java 21 is now the minimum required version:

  • README.md: Changed minimum JDK requirement from Java 8 to Java 21.
  • pom.xml: Removed the java17 Maven profile. An identical java21 profile already exists with the same mockito-core and byte-buddy dependency overrides, making the java17 profile redundant.
  • OpenmrsUtil.java: Rewrote validateJavaVersion() to check for Java 21+ instead of Java 8+. The old regex (1\\.[0-7]\\.(.*)) only caught legacy version strings (Java 7 and below) and wouldn't have rejected Java 8–20 under modern version formats. The new implementation parses the major version number from both legacy 1.x.y and modern X.Y.Z version strings.

Things for reviewers to verify

  • Version parsing edge cases: The new validateJavaVersion() would reject early-access JDK builds (e.g., "21-ea") because Integer.parseInt("21-ea") falls into the NumberFormatException catch, setting majorVersion = 0. Determine if this is acceptable or if the hyphen should be stripped before parsing.
  • No tests were added for the rewritten validateJavaVersion() logic. Consider whether the existing test suite covers this or if new tests are needed.
  • java17 profile removal: Confirm that the project no longer needs to support building with JDK 17 before merging.

Issue I worked on

see https://issues.openmrs.org/browse/TRUNK-

Checklist: I completed these to help reviewers :)

  • My IDE is configured to follow the code style of this project.
  • I have added tests to cover my changes. (If you refactored existing code that was well tested you do not have to add tests)
  • I ran mvn clean package right before creating this pull request and added all formatting changes to my commit.
  • All new and existing tests passed.
  • My pull request is based on the latest changes of the master branch.

Link to Devin run: https://app.devin.ai/sessions/c1f60c01567741799798bdd917fa4d2a
Requested by: @dillonvargo

Co-Authored-By: Dillon Vargo <dillonvargo@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown

🤖 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