Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR removes the deprecated build script Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
javacutil/src/main/java/org/checkerframework/javacutil/SystemUtil.java (1)
172-194: 🛠️ Refactor suggestion | 🟠 MajorRemove
getJreVersion()instead of deprecating private dead code.After Line 155, this private method is no longer used. Deprecating a private method does not provide migration value and keeps unnecessary parsing logic/imports.
♻️ Proposed cleanup
-import java.util.regex.Matcher; -import java.util.regex.Pattern; @@ - // Keep in sync with BCELUtil.java (in the bcel-util project). - /** - * Returns the major version number from the "java.version" system property, such as 8, 11, or 17. - * - * <p>This is different from the version passed to the compiler via {`@code` --release}; use {`@link` - * `#getReleaseValue`(ProcessingEnvironment)} to get that version. - * - * <p>Two possible formats of the "java.version" system property are considered. Up to Java 8, - * from a version string like `1.8.whatever`, this method extracts 8. Since Java 9, from a version - * string like `11.0.1`, this method extracts 11. - * - * <p>Starting in Java 9, there is the int {`@code` Runtime.version().feature()}, but that does not - * exist on JDK 8. - * - * `@return` the major version of the Java runtime - * `@deprecated` use {`@code` Runtime.version().feature()} - */ - `@Deprecated`(forRemoval = true, since = "4.1.0") - private static int getJreVersion() { - String version = System.getProperty("java.version"); - - // Up to Java 8, from a version string like "1.8.whatever", extract "8". - if (version.startsWith("1.")) { - return Integer.parseInt(version.substring(2, 3)); - } - - // Since Java 9, from a version string like "11.0.1" or "11-ea" or "11u25", extract "11". - // The format is described at https://openjdk.org/jeps/223 . - Pattern newVersionPattern = Pattern.compile("^(\\d+).*$"); - Matcher newVersionMatcher = newVersionPattern.matcher(version); - if (newVersionMatcher.matches()) { - String v = newVersionMatcher.group(1); - assert v != null : "@AssumeAssertion(nullness): inspection"; - return Integer.parseInt(v); - } - - throw new RuntimeException("Could not determine version from property java.version=" + version); - }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@javacutil/src/main/java/org/checkerframework/javacutil/SystemUtil.java` around lines 172 - 194, Remove the dead private method getJreVersion() and any related unused imports (e.g., Pattern and Matcher) since it is not referenced elsewhere; locate the method named getJreVersion in SystemUtil and delete its entire definition along with the Deprecated annotation and associated Javadoc, then run a build/IDE cleanup to drop now-unused imports.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@javacutil/src/main/java/org/checkerframework/javacutil/SystemUtil.java`:
- Around line 172-194: Remove the dead private method getJreVersion() and any
related unused imports (e.g., Pattern and Matcher) since it is not referenced
elsewhere; locate the method named getJreVersion in SystemUtil and delete its
entire definition along with the Deprecated annotation and associated Javadoc,
then run a build/IDE cleanup to drop now-unused imports.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: f48b9cbb-3cea-4781-a46a-a0da7761131f
📒 Files selected for processing (5)
checker-util/src/main/java/org/checkerframework/checker/signedness/util/SignednessUtil.javachecker/bin-devel/build.shchecker/src/main/java/org/checkerframework/checker/calledmethods/CalledMethodsChecker.javadocs/CHANGELOG.mdjavacutil/src/main/java/org/checkerframework/javacutil/SystemUtil.java
💤 Files with no reviewable changes (2)
- checker/bin-devel/build.sh
- checker/src/main/java/org/checkerframework/checker/calledmethods/CalledMethodsChecker.java
getJreVersion(), and remove old deprecated code
No description provided.