Upgrade Java version references from Java 8/17 to Java 21#22
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
Upgrade Java version references from Java 8/17 to Java 21#22devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
- Update validateJavaVersion() to properly check for Java 21 minimum - Update README.md to state Java 21 as minimum JDK requirement - Remove obsolete Java 17 Maven profile (Java 21 is now minimum) - Update test method name to reflect Java 21 requirement Co-Authored-By: unknown <>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Description of what I changed
Updates all outdated Java version references across the codebase to reflect that Java 21 is the minimum required version:
OpenmrsUtil.validateJavaVersion(): Rewrote the validation logic to properly enforce Java 21 as the minimum. The old implementation used a regex (1\\.[0-7]\\.(.*)) that only caught Java 7 and earlier, which was ineffective even for Java 8 enforcement. The new implementation parses the major version number fromjava.version, handling both the legacy1.x.yscheme (Java 8 and earlier) and the modernx.y.zscheme (Java 9+), and rejects anything below 21.README.md: Updated the documented minimum JDK requirement from version 8 to version 21.pom.xml: Removed thejava17Maven profile. Since Java 21 is now the minimum, the Java 17 compatibility profile for Mockito/ByteBuddy is no longer needed. Thejava21andjava24profiles are retained.JavaVersionTest.java: Renamed test method to reflect the Java 21 requirement.Important items for review
validateJavaVersion()— Verify the parsing handles edge cases correctly (e.g.,21.0.1,21-ea,1.8.0_292). There are no unit tests for specific version string formats; the existing test only validates the happy path on the current JVM.JavaVersionTestwould fail locally (expected, since 17 < 21). CI must run on Java 21+ for the test suite to pass.Issue I worked on
see https://issues.openmrs.org/browse/TRUNK-
Checklist: I completed these to help reviewers :)
mvn clean packageright before creating this pull request and added all formatting changes to my commit.Link to Devin run: https://app.devin.ai/sessions/e7f727e392644473ab6aaf56e4456fab
Requested by: @dillonvargo