Update all Java version references to align with Java 21 target#30
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
Update all Java version references to align with Java 21 target#30devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
- test-module/pom.xml: Update javaCompilerVersion from 1.8 to 21 - OpenmrsUtil.java: Rewrite validateJavaVersion() to use Runtime.version().feature() and require Java 21+ - README.md: Update minimum Java version from 8 to 21 - tools/pom.xml: Remove obsolete com.sun:tools profiles (dead code since Java 9) - pom.xml: Update stale Java 8 comment in the Java 17 mockito profile Co-Authored-By: Dillon Vargo <dillonvargo@gmail.com>
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 align with the project's Java 21 target (already set in the root
pom.xmlasjavaCompilerVersion=21).Changes:
test-module/pom.xml— UpdatedjavaCompilerVersionfrom1.8to21so the test module compiles with the same target as the rest of the project.OpenmrsUtil.java—validateJavaVersion()— Replaced the old regex-based check (1\\.[0-7]\\.(.*)) withRuntime.version().feature() < 21. The old regex only rejected Java 1.0–1.7 using the legacy1.xnaming scheme and could never reject Java 8–20 (which use the modern naming scheme like21.0.1). The new implementation correctly enforces a minimum of Java 21. Updated Javadoc and error message accordingly.README.md— Updated minimum Java version from 8 to 21 in the build prerequisites.tools/pom.xml— Removed bothdefault-tools.jarandmac-tools.jarprofiles. These referencedcom.sun:tools/tools.jar, which was removed from the JDK in Java 9 (Project Jigsaw). On Java 21 these profiles are dead code — the activation file-exists conditions can never be true.pom.xml— Updated the stale comment on the Java 17 mockito profile that incorrectly referenced Java 8 compatibility. The new comment accurately describes the NullPointerException issue with mockito-core:3.12.4 on Java 17.Key review points
validateJavaVersion()rewrite: UsesRuntime.version().feature()(available since Java 10) instead of regex parsing. Verify this is the desired approach vs. other alternatives.tools/pom.xmlprofile removal: Confirm no other module or build step depends on thecom.sun:toolsartifact declaration.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 session: https://app.devin.ai/sessions/362a17cce8394d50b8e5afdbbc7a9507
Requested by: @dillonvargo