Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ jobs:
steps:
- name: Check out NullAway sources
uses: actions/checkout@v6
- name: 'Set up JDKs'
- name: 'Set up JDK 27 EA from jdk.java.net'
uses: oracle-actions/setup-java@v1
with:
website: jdk.java.net
release: 27
- name: 'Set up Default JDK'
uses: actions/setup-java@v5
with:
java-version: 25
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ test {
}

// Tasks for testing on other JDK versions; see https://jakewharton.com/build-on-latest-java-test-through-lowest-java/
[21, 26].each { majorVersion ->
[21, 26, 27].each { majorVersion ->
def jdkTest = tasks.register("testJdk$majorVersion", Test) {
javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(majorVersion)
Expand Down
4 changes: 4 additions & 0 deletions jar-infer/jar-infer-lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,8 @@ tasks.withType(JavaCompile).configureEach {
options.compilerArgs += "--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED"
}

tasks.getByName('testJdk27').configure {
// Won't work until WALA supports JDK 27
onlyIf { false }
}
apply plugin: 'com.vanniktech.maven.publish'
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,14 @@ private NullnessStore lambdaInitialStore(
Element element = param.getElement();
Nullness assumed;
// we treat lambda parameters differently; they "inherit" the nullability of the
// corresponding functional interface parameter, unless they are explicitly annotated
if (Nullness.hasNullableAnnotation((Symbol) element, config)) {
// corresponding functional interface parameter, unless they are explicitly annotated.
//
// We look for explicit @Nullable annotations on the symbol. In JDK 27+, sometimes
// javac will add a @Nullable annotation to the Type of element based on its own generic
// inference. We don't want to consider that here (it is handled in the type stored in
// fiArgumentNullness), so we only look at the annotations directly on element
if (Nullness.hasNullableAnnotation(
((Symbol) element).getAnnotationMirrors().stream(), config)) {
assumed = NULLABLE;
} else if (!NullabilityUtil.lambdaParamIsImplicitlyTyped(variableTree)) {
// the parameter has a declared type with no @Nullable annotation
Expand Down
Loading