Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@msridhar
Copy link
Collaborator

@msridhar msridhar commented Sep 22, 2025

We update to the latest WALA release, which supports running on JDK 25, so we can re-enable JarInfer tests. Note that running JarInfer now does not work on Temurin, since they exclude .jmod files from their distribution (see the WALA docs). So we switch our CI JDKs to be from the Zulu distribution.

According to the CI job proposal from #1271, we should also be switching to building on JDK 25, with a separate test job for JDK 21. I will hold off on that for a bit (to check stability) and then do it in a separate PR, along with an upgrade to Gradle 9.1.0 which supports running on JDK 25.

Fixes #1189

Summary by CodeRabbit

  • New Features

    • Added compatibility with JDK 25 by expanding the supported Java version matrix.
  • Tests

    • Updated toolchain and test tasks to target JDK 25.
    • Removed a previous workaround that disabled a specific JDK test task.
  • Chores

    • Upgraded dependencies: WALA to 1.6.12 and Mockito to 5.19.0.
  • Build/CI

    • CI and test generation now include JDK 25; CI JDK distribution switched to Zulu.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 22, 2025

Walkthrough

Expands tested JDK range to include 25 across build scripts and CI, bumps WALA and Mockito versions, removes a disabled testJdk24 guard in JarInfer build, and replaces FileOfClasses with PatternsFilter for exclusions in JarInfer's analysis driver.

Changes

Cohort / File(s) Summary
Test JDK matrix update
buildSrc/src/main/groovy/nullaway.java-test-conventions.gradle
Expands generated test JDK major versions from [17, 24] to [17, 25].
CI JDK setup
.github/workflows/continuous-integration.yml
Adds JDK 25 to the "Set up JDKs" step and switches distribution to zulu in one job.
Recent JDK unit tests
jdk-recent-unit-tests/build.gradle
Sets Java toolchain languageVersion to 25 (was 24) and re-targets the testJdk25 task (replacing testJdk24) with the same guard.
JarInfer build task adjustment
jar-infer/jar-infer-lib/build.gradle
Removes the onlyIf { false } configuration that disabled testJdk24 (task guard removed).
JarInfer exclusion filter change
jar-infer/jar-infer-lib/src/main/java/.../DefinitelyDerefedParamsDriver.java
Replaces FileOfClasses with PatternsFilter for exclusions when building the analysis scope; import updated accordingly.
Dependency version bumps
gradle/dependencies.gradle
Bumps WALA 1.6.91.6.12 and Mockito core org.mockito:mockito-core:5.16.15.19.0.

Sequence Diagram(s)

sequenceDiagram
  participant Dev as Developer (PR)
  participant GH as GitHub Actions
  participant Gradle as Gradle
  participant Tests as Test tasks

  Note over Dev,GH: PR updates JDK targets, toolchains, deps, and JarInfer code
  Dev->>GH: push changes
  GH->>Gradle: checkout + setup JDKs (includes 25)
  Gradle->>Gradle: generate test tasks for each JDK (17..25)
  Gradle->>Tests: run test tasks (testJdk25 included)
  alt Previously disabled JarInfer JDK task
    Gradle->>Tests: now allows JarInfer JDK task to run (no onlyIf { false })
  end
  Gradle->>Gradle: apply bumped dependency versions (WALA, Mockito)
  Tests-->>GH: report results
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Simplified set of CI jobs #1271 — Overlaps changes to the CI workflow and Gradle test-task/JDK matrix (affects nullaway.java-test-conventions.gradle and CI config).

Suggested reviewers

  • yuxincs
  • lazaroclapp

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Out of Scope Changes Check ⚠️ Warning There are edits that look outside the narrow objective of "enable JarInfer to run on a newer JDK": a Mockito test dependency bump in gradle/dependencies.gradle, the import/class change in DefinitelyDerefedParamsDriver (FileOfClasses → PatternsFilter) which appears to be an internal refactor, and GitHub Actions changes switching the JDK distribution from Temurin to Zulu and adding a JDK 25 runner; these changes are not strictly required by the linked issue and increase the surface area of the PR. The WALA bump, test-toolchain and jar-infer test-task adjustments are in-scope for #1189, but the additional dependency and workflow/distribution changes should be justified or separated. Please split unrelated changes into separate PRs or document the rationale in this PR: if the Mockito upgrade, PatternsFilter change, or switching CI to Zulu are necessary for JDK25/WALA compatibility, add a short justification and targeted test evidence in the description; otherwise move them to follow-up PRs to keep the JDK-support change minimal and reviewable.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues Check ✅ Passed The PR updates the WALA dependency (gradle/dependencies.gradle), expands test conventions and toolchain targets to include JDK 25 (buildSrc nullaway test conventions and jdk-recent-unit-tests), and removes the prior gating that prevented JarInfer tests from running, which together implement the coding changes needed to enable JarInfer to run on a newer JDK as described in issue #1189. Although the linked issue originally referenced JDK 24, targeting JDK 25 meets the same objective because the blocker was WALA support and the PR upgrades WALA to a release that supports the newer JDK. Based on the provided changes, the PR appears to satisfy the linked issue's coding objectives.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "Test on JDK 25" is concise and accurately summarizes the primary change—updating tests/toolchains/CI to target JDK 25 (and related dependency updates to enable that), so it clearly communicates the main intent to reviewers. It is specific and readable without extraneous information.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch jdk-25

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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
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.

Actionable comments posted: 0

🧹 Nitpick comments (2)
jdk-recent-unit-tests/build.gradle (1)

25-25: Minor: modernize the toolchain setter and sync comments

Use parentheses for readability and update nearby comment (Line 21) to “Use JDK 25”.

-java.toolchain.languageVersion.set JavaLanguageVersion.of(25)
+java.toolchain.languageVersion.set(JavaLanguageVersion.of(25))
jar-infer/jar-infer-lib/src/main/java/com/uber/nullaway/jarinfer/DefinitelyDerefedParamsDriver.java (1)

243-245: Add trailing newline to DEFAULT_EXCLUSIONS when building PatternsFilter

Some pattern parsers require a trailing newline for the final pattern — append "\n" before getting bytes.

-    scope.setExclusions(
-        new PatternsFilter(
-            new ByteArrayInputStream(DEFAULT_EXCLUSIONS.getBytes(StandardCharsets.UTF_8))));
+    scope.setExclusions(
+        new PatternsFilter(
+            new ByteArrayInputStream((DEFAULT_EXCLUSIONS + "\n").getBytes(StandardCharsets.UTF_8))));

No FileOfClasses occurrences found; only this setExclusions call in jar-infer/jar-infer-lib/src/main/java/com/uber/nullaway/jarinfer/DefinitelyDerefedParamsDriver.java.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d0abadd and 4121bb0.

📒 Files selected for processing (5)
  • buildSrc/src/main/groovy/nullaway.java-test-conventions.gradle (1 hunks)
  • gradle/dependencies.gradle (2 hunks)
  • jar-infer/jar-infer-lib/build.gradle (0 hunks)
  • jar-infer/jar-infer-lib/src/main/java/com/uber/nullaway/jarinfer/DefinitelyDerefedParamsDriver.java (2 hunks)
  • jdk-recent-unit-tests/build.gradle (2 hunks)
💤 Files with no reviewable changes (1)
  • jar-infer/jar-infer-lib/build.gradle
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
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.
📚 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:

  • buildSrc/src/main/groovy/nullaway.java-test-conventions.gradle
  • jdk-recent-unit-tests/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). (4)
  • GitHub Check: Build spring-framework with snapshot
  • GitHub Check: Build and test on windows-latest
  • GitHub Check: Build and test on macos-latest
  • GitHub Check: Build caffeine with snapshot
🔇 Additional comments (4)
buildSrc/src/main/groovy/nullaway.java-test-conventions.gradle (1)

68-92: Expanding the matrix to JDK 25 looks good

Changes align with the PR goal and EP gating remains intact.

jar-infer/jar-infer-lib/src/main/java/com/uber/nullaway/jarinfer/DefinitelyDerefedParamsDriver.java (1)

50-50: Migration to WALA PatternsFilter is correct

Import/update matches WALA API changes; constructor with an InputStream is the right choice.

Also applies to: 243-245

gradle/dependencies.gradle (1)

57-57: Verify JDK 25 compatibility for WALA 1.6.12 and Mockito 5.19.0

  • WALA 1.6.12 — no explicit JDK‑25 support found in release notes (support recorded up to JDK‑23). Action: run CI/tests on JDK 25 or search WALA issues/PRs for JDK‑25 work. (gradle/dependencies.gradle:57)

  • Mockito 5.19.0 — release notes call out JDK‑21 only; runtime on JDK‑25 depends on Byte Buddy. Action: confirm resolved net.bytebuddy version >= 1.17.5 (or apply the net.bytebuddy.experimental workaround), upgrade if needed, then run CI/tests on JDK 25. (gradle/dependencies.gradle:129)

jdk-recent-unit-tests/build.gradle (1)

56-62: Incorrect — disabling only testJdk17/testJdk25 is sufficient; there are no testJdk18–24 tasks.

buildSrc/src/main/groovy/nullaway.java-test-conventions.gradle registers testJdk tasks only for [17, 25], so the getByName disables in jdk-recent-unit-tests/build.gradle (lines ~56–62) correctly target the only testJdk tasks; no change required.

Likely an incorrect or invalid review comment.

Copy link
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.

Actionable comments posted: 0

🧹 Nitpick comments (1)
.github/workflows/continuous-integration.yml (1)

24-31: Optional: add check-latest to reduce “25 not found” flakiness right after GA.

This ensures setup-java downloads the latest Temurin 25 even if it isn’t pre-cached on a given runner image yet. (github.com)

       with:
         java-version: |
           25
           21
         distribution: 'temurin'
+        check-latest: true
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4121bb0 and 9bf004b.

📒 Files selected for processing (1)
  • .github/workflows/continuous-integration.yml (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
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.
⏰ 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). (3)
  • GitHub Check: Build spring-framework with snapshot
  • GitHub Check: Build caffeine with snapshot
  • GitHub Check: Build and test on ubuntu-latest
🔇 Additional comments (1)
.github/workflows/continuous-integration.yml (1)

27-31: LGTM — JDK 25 added; Gradle toolchains reference JDK 25. CI installs both JDK 25 and 21; repository contains toolchain usages referencing 25 (jdk-recent-unit-tests/build.gradle: java.toolchain.languageVersion.set JavaLanguageVersion.of(25); buildSrc/src/main/groovy/nullaway.java-test-conventions.gradle: registers testJdk25).

@codecov
Copy link

codecov bot commented Sep 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.49%. Comparing base (43788a0) to head (93d0efa).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1301   +/-   ##
=========================================
  Coverage     88.49%   88.49%           
  Complexity     2476     2476           
=========================================
  Files            93       93           
  Lines          8214     8214           
  Branches       1617     1617           
=========================================
  Hits           7269     7269           
  Misses          474      474           
  Partials        471      471           

☔ 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) September 23, 2025 22:49
@msridhar msridhar merged commit 062c27c into master Sep 24, 2025
10 of 11 checks passed
@msridhar msridhar deleted the jdk-25 branch September 24, 2025 01:09
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.

Support running on JDK 24 in JarInfer once WALA supports it

3 participants