Skip to content

Commit 062c27c

Browse files
authored
Test on JDK 25 (#1301)
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](https://github.com/wala/WALA/wiki/Analysis-Scope)). 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 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## 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. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 43788a0 commit 062c27c

6 files changed

Lines changed: 10 additions & 14 deletions

File tree

.github/workflows/continuous-integration.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ jobs:
2525
uses: actions/setup-java@v4
2626
with:
2727
java-version: |
28+
25
2829
21
29-
distribution: 'temurin'
30+
distribution: 'zulu'
3031
- name: Setup Gradle
3132
uses: gradle/actions/setup-gradle@v4
3233
- name: Build and test
@@ -72,7 +73,7 @@ jobs:
7273
uses: actions/setup-java@v4
7374
with:
7475
java-version: 21
75-
distribution: 'temurin'
76+
distribution: 'zulu'
7677
- name: Setup Gradle
7778
uses: gradle/actions/setup-gradle@v4
7879
- name: Publish to Maven Local

buildSrc/src/main/groovy/nullaway.java-test-conventions.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ test {
6565
}
6666

6767
// Tasks for testing on other JDK versions; see https://jakewharton.com/build-on-latest-java-test-through-lowest-java/
68-
[17, 24].each { majorVersion ->
68+
[17, 25].each { majorVersion ->
6969
def jdkTest = tasks.register("testJdk$majorVersion", Test) {
7070
onlyIf {
7171
// Only run when using the latest Error Prone version

gradle/dependencies.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def versions = [
5454
// The version of Error Prone that NullAway is compiled and tested against
5555
errorProneApi : errorProneVersionToCompileAgainst,
5656
support : "27.1.1",
57-
wala : "1.6.9",
57+
wala : "1.6.12",
5858
commonscli : "1.4",
5959
autoValue : "1.10.2",
6060
autoService : "1.1.1",
@@ -126,7 +126,7 @@ def test = [
126126
springBeans : "org.springframework:spring-beans:5.3.7",
127127
springContext : "org.springframework:spring-context:5.3.7",
128128
grpcCore : "io.grpc:grpc-core:1.15.1", // Should upgrade, but this matches our guava version
129-
mockito : "org.mockito:mockito-core:5.16.1",
129+
mockito : "org.mockito:mockito-core:5.19.0",
130130
javaxAnnotationApi : "javax.annotation:javax.annotation-api:1.3.2",
131131
assertJ : "org.assertj:assertj-core:3.23.1",
132132
amazonUtils : "software.amazon.awssdk:utils:2.32.19",

jar-infer/jar-infer-lib/build.gradle

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,4 @@ tasks.withType(JavaCompile).configureEach {
5050
options.compilerArgs += "--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED"
5151
}
5252

53-
tasks.getByName('testJdk24').configure {
54-
// Will not work until WALA is updated to support JDK 24; see https://github.com/uber/NullAway/issues/1189
55-
onlyIf { false }
56-
}
57-
5853
apply plugin: 'com.vanniktech.maven.publish'

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
import com.ibm.wala.types.generics.TypeSignature;
4848
import com.ibm.wala.types.generics.TypeVariableSignature;
4949
import com.ibm.wala.util.collections.Iterator2Iterable;
50-
import com.ibm.wala.util.config.FileOfClasses;
50+
import com.ibm.wala.util.config.PatternsFilter;
5151
import com.uber.nullaway.libmodel.MethodAnnotationsRecord;
5252
import com.uber.nullaway.libmodel.StubxWriter;
5353
import java.io.ByteArrayInputStream;
@@ -240,7 +240,7 @@ private void analyzeFile(String pkgName, String inPath, boolean includeNonPublic
240240
}
241241
AnalysisScope scope = AnalysisScopeReader.instance.makeBasePrimordialScope(null);
242242
scope.setExclusions(
243-
new FileOfClasses(
243+
new PatternsFilter(
244244
new ByteArrayInputStream(DEFAULT_EXCLUSIONS.getBytes(StandardCharsets.UTF_8))));
245245
if (jarIS != null) {
246246
scope.addInputStreamForJarToScope(ClassLoaderReference.Application, jarIS);

jdk-recent-unit-tests/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ plugins {
2222
// We must null out sourceCompatibility and targetCompatibility to use toolchains.
2323
java.sourceCompatibility = null
2424
java.targetCompatibility = null
25-
java.toolchain.languageVersion.set JavaLanguageVersion.of(24)
25+
java.toolchain.languageVersion.set JavaLanguageVersion.of(25)
2626

2727
configurations {
2828
// We use this configuration to expose a module path that can be
@@ -57,7 +57,7 @@ tasks.withType(Test).configureEach { test ->
5757
tasks.getByName('testJdk17').configure {
5858
onlyIf { false }
5959
}
60-
tasks.getByName('testJdk24').configure {
60+
tasks.getByName('testJdk25').configure {
6161
onlyIf { false }
6262
}
6363

0 commit comments

Comments
 (0)