From e1298df038ac2e031c066e305714a59e7e552483 Mon Sep 17 00:00:00 2001 From: Manu Sridharan Date: Wed, 2 Oct 2024 15:59:47 -0700 Subject: [PATCH] Update to Checker Framework 3.48.0 (#1030) Fixes #1012. [Benchmarking](https://github.com/uber/NullAway/pull/1030#issuecomment-2389637778) shows any perf difference is within the noise. --- gradle/dependencies.gradle | 2 +- .../test/java/com/uber/nullaway/CoreTests.java | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index 9d2de3dea1..76de418ec4 100755 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -40,7 +40,7 @@ if (project.hasProperty("epApiVersion")) { def versions = [ asm : "9.3", - checkerFramework : "3.43.0", + checkerFramework : "3.48.0", // for comparisons in other parts of the build errorProneLatest : latestErrorProneVersion, // The version of Error Prone used to check NullAway's code. diff --git a/nullaway/src/test/java/com/uber/nullaway/CoreTests.java b/nullaway/src/test/java/com/uber/nullaway/CoreTests.java index f3eb4d3711..a851d8efb2 100644 --- a/nullaway/src/test/java/com/uber/nullaway/CoreTests.java +++ b/nullaway/src/test/java/com/uber/nullaway/CoreTests.java @@ -1053,4 +1053,20 @@ public void testStaticImportFromSubclass() { "}") .doTest(); } + + /** testing for no Checker Framework crash */ + @Test + public void ternaryBothCasesNull() { + defaultCompilationHelper + .addSourceLines( + "TestCase.java", + "package com.uber;", + "import org.jspecify.annotations.Nullable;", + "public class TestCase {", + " public static @Nullable String foo(String x) {", + " return x.isEmpty() ? null : null;", + " }", + "}") + .doTest(); + } }