Skip to content

Require JDK 21 to build. - #7343

Merged
mernst merged 1 commit into
typetools:masterfrom
smillst:java-version
Oct 29, 2025
Merged

mernst merged 1 commit into
typetools:masterfrom
smillst:java-version

Conversation

@smillst

@smillst smillst commented Oct 28, 2025

Copy link
Copy Markdown
Member

No description provided.

@coderabbitai

coderabbitai Bot commented Oct 28, 2025

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

  • In settings.gradle, the Java version guard was updated: it now throws an error when JavaVersion.current() is less than JavaVersion.VERSION_21, effectively requiring Java 21 or higher.
  • The previous check for equality to Java 8 was removed.
  • The error message was updated to reflect the Java 21+ requirement.
  • Control flow for handling unsupported Java versions remains the same.
  • No exported or public declarations were modified.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1de864f and 94cf477.

📒 Files selected for processing (1)
  • settings.gradle (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: typetools.checker-framework (typecheck_part2_jdk25)
  • GitHub Check: typetools.checker-framework (typecheck_part1_jdk25)
  • GitHub Check: typetools.checker-framework (misc_jdk25)
  • GitHub Check: typetools.checker-framework (inference_part1_jdk25)
  • GitHub Check: typetools.checker-framework (nonjunit_jdk25)
  • GitHub Check: typetools.checker-framework (junit_jdk25)
  • GitHub Check: typetools.checker-framework (inference_part2_jdk25)
🔇 Additional comments (1)
settings.gradle (1)

2-3: Use GradleException and report detected JDK; verify wrapper supports Java 21.

Throw GradleException (not Error) and include the detected version/home for quicker diagnosis. Also confirm the Gradle wrapper is ≥ 8.5 to run on JDK 21 and for JavaVersion.VERSION_21 to exist.

-  if (JavaVersion.current() < JavaVersion.VERSION_21) {
-    throw new Error("The Checker Framework must be built with Java 21+.")
-  }
+  if (JavaVersion.current() < JavaVersion.VERSION_21) {
+    def current = JavaVersion.current()
+    def javaHome = System.properties.'java.home'
+    throw new GradleException("Build requires Java 21+. Detected: ${current} (java.home=${javaHome})")
+  }

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.

@mernst mernst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@mernst
mernst enabled auto-merge (squash) October 28, 2025 16:55
@mernst
mernst merged commit 6b1957b into typetools:master Oct 29, 2025
@mernst
mernst deleted the java-version branch October 29, 2025 00:15
@coderabbitai coderabbitai Bot mentioned this pull request Mar 12, 2026
@coderabbitai coderabbitai Bot mentioned this pull request Apr 11, 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