Skip to content

Enable building NullAway on JDK 25#1315

Merged
msridhar merged 5 commits intomasterfrom
enable-building-with-jdk-25
Oct 20, 2025
Merged

Enable building NullAway on JDK 25#1315
msridhar merged 5 commits intomasterfrom
enable-building-with-jdk-25

Conversation

@msridhar
Copy link
Copy Markdown
Collaborator

@msridhar msridhar commented Oct 19, 2025

Requires bumping some build-related deps. Also give an error if someone tries to build with a JDK earlier than 21, as that is no longer supported.

Summary by CodeRabbit

  • Chores
    • Updated build system plugins and development dependencies to improve development environment stability and code quality tooling.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Oct 19, 2025

Walkthrough

This pull request updates multiple build dependencies and configuration in the Gradle build files. The Gradle Android Plugin, Spotless plugin, and Error Prone plugin versions are bumped to newer releases. A new currentJavaVersion variable is introduced to improve JDK version handling, with specific adjustments to JDK 21 support requiring version 21.0.8 or later. The Spotless Groovy formatting rule is modified to use leadingTabsToSpaces(4) instead of indentWithSpaces(4). Additionally, the googlejavaformat dependency is upgraded from 1.24.0 to 1.30.0.

Possibly related PRs

Suggested reviewers

  • lazaroclapp
  • yuxincs

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "Enable building NullAway on JDK 25" directly and clearly summarizes the main objective of the changeset. The PR description confirms this focus: bumping build-related dependencies to enable building NullAway with JDK 25 and adding a build-time check for JDK 21 as the minimum supported version. All the actual changes—dependency version bumps (Gradle Android Plugin, Spotless, Error Prone, and googlejavaformat), Java version compatibility checks, and Spotless formatting adjustments—are in service of this primary goal. The title is concise, specific, and conveys meaningful information about the changeset without being vague or misleading.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch enable-building-with-jdk-25

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between defbda5 and 6ba4d7e.

📒 Files selected for processing (2)
  • build.gradle (3 hunks)
  • gradle/dependencies.gradle (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-14T18:50:06.159Z
Learnt from: msridhar
PR: uber/NullAway#1245
File: guava-recent-unit-tests/src/test/java/com/uber/nullaway/guava/NullAwayGuavaParametricNullnessTests.java:101-102
Timestamp: 2025-08-14T18:50:06.159Z
Learning: In NullAway JSpecify tests, when JDK version requirements exist due to bytecode annotation reading capabilities, prefer failing tests over skipping them on unsupported versions to ensure CI catches regressions and enforces proper JDK version usage for developers.

Applied to files:

  • build.gradle
⏰ 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). (5)
  • GitHub Check: Build and test on ubuntu-latest
  • GitHub Check: Build caffeine with snapshot
  • GitHub Check: Build spring-framework with snapshot
  • GitHub Check: Build and test on macos-latest
  • GitHub Check: Build and test on windows-latest
🔇 Additional comments (4)
build.gradle (3)

45-59: JDK version checks look sound.

The two-stage validation is well-structured: first ensure JDK 21+, then for JDK 21 specifically, enforce 21.0.8+. This aligns with the learning that JDK version requirements (e.g., for bytecode annotation reading) should trigger hard failures rather than graceful skips. Error messages are clear and actionable.


139-139: Confirm the behavioral change from indentWithSpaces to leadingTabsToSpaces is intentional.

The method leadingTabsToSpaces is valid in Spotless 8.0.0, added as a replacement for indentWithSpaces in the 7.0.0 release. However, this represents a behavioral shift: indentWithSpaces(4) indents code with spaces, while leadingTabsToSpaces(4) converts existing leading tabs to spaces. Verify this is the desired formatting behavior for Gradle files in your codebase.


25-25: Confirm plugin compatibility testing given the version updates.

Spotless 8.0.0 requires Gradle 7.3+ and Java 17, and renamed removeWildcardImports to forbidWildcardImports. The API change from indentWithSpaces to leadingTabsToSpaces on line 139 is correct for this upgrade. However, the Gradle compatibility matrix only tests AGP versions 8.4 through 8.12, leaving AGP 8.13.0 compatibility unconfirmed in official documentation. Before merging, verify the project's Gradle version (in gradle/wrapper/gradle-wrapper.properties) meets Spotless's 7.3+ requirement and test that all three plugin versions build successfully together.

gradle/dependencies.gradle (1)

62-62: Verification confirms googlejavaformat 1.30.0 is compatible with Spotless 8.0.0.

Spotless supports using google-java-format 1.30.0 with proper configuration. The version bump is safe to proceed with. Standard best practice: ensure your project's JDK version remains compatible with google-java-format releases, though this is a routine consideration for any tool upgrade.


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.

@codecov
Copy link
Copy Markdown

codecov bot commented Oct 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.42%. Comparing base (0a2e2b0) to head (d1a90f7).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1315   +/-   ##
=========================================
  Coverage     88.42%   88.42%           
  Complexity     2523     2523           
=========================================
  Files            94       94           
  Lines          8415     8415           
  Branches       1661     1661           
=========================================
  Hits           7441     7441           
  Misses          491      491           
  Partials        483      483           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@msridhar msridhar enabled auto-merge (squash) October 19, 2025 17:56
@msridhar msridhar merged commit c6d2ba3 into master Oct 20, 2025
11 checks passed
@msridhar msridhar deleted the enable-building-with-jdk-25 branch October 20, 2025 22:30
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