Skip to content

Remove old deprecated code#7650

Open
mernst wants to merge 4 commits intotypetools:masterfrom
mernst:remove-deprecated
Open

Remove old deprecated code#7650
mernst wants to merge 4 commits intotypetools:masterfrom
mernst:remove-deprecated

Conversation

@mernst
Copy link
Copy Markdown
Member

@mernst mernst commented Apr 13, 2026

No description provided.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 13, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: ef9e4cc8-0cd5-4b3a-a349-e2aadc652aa3

📥 Commits

Reviewing files that changed from the base of the PR and between 8024ffb and 065c0d8.

📒 Files selected for processing (1)
  • checker/src/main/java/org/checkerframework/checker/rlccalledmethods/RLCCalledMethodsChecker.java

📝 Walkthrough

Walkthrough

This PR removes the deprecated build script checker/bin-devel/build.sh, deletes the @SuppressWarningsPrefix annotation and deprecated aliases from CalledMethodsChecker, initializes SystemUtil.jreVersion via Runtime.version().feature() (removing the legacy getJreVersion() parser), and updates the Javadoc and removes the @Deprecated annotation from the private helper SignednessUtil.toUnsignedBigInteger. The changelog is advanced to version 4.1.0.

Possibly related PRs

Suggested reviewers

  • smillst
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 | 🟠 Major

Remove 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

📥 Commits

Reviewing files that changed from the base of the PR and between 7e9dd23 and 42b25a7.

📒 Files selected for processing (5)
  • checker-util/src/main/java/org/checkerframework/checker/signedness/util/SignednessUtil.java
  • checker/bin-devel/build.sh
  • checker/src/main/java/org/checkerframework/checker/calledmethods/CalledMethodsChecker.java
  • docs/CHANGELOG.md
  • javacutil/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

@mernst mernst changed the title Deprecate getJreVersion(), and remove old deprecated code Remove old deprecated code Apr 13, 2026
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.

2 participants