Skip to content

Commit

Permalink
Downgrade to Checker Framework 3.40.0 (#895)
Browse files Browse the repository at this point in the history
This fixes a regression where we were seeing a crash in CFG
construction. Reported upstream as
typetools/checker-framework#6396.
  • Loading branch information
msridhar committed Jan 14, 2024
1 parent 9ff44a7 commit c7007fd
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if (project.hasProperty("epApiVersion")) {

def versions = [
asm : "9.3",
checkerFramework : "3.41.0",
checkerFramework : "3.40.0",
// for comparisons in other parts of the build
errorProneLatest : latestErrorProneVersion,
// The version of Error Prone used to check NullAway's code.
Expand Down
3 changes: 3 additions & 0 deletions nullaway/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ dependencies {
testImplementation deps.test.mockito
testImplementation deps.test.javaxAnnotationApi
testImplementation deps.test.assertJ
// This is for a test exposing a CFG construction failure in the Checker Framework. We can probably remove it once
// the issue is fixed upstream and we update. See https://github.com/typetools/checker-framework/issues/6396.
testImplementation 'org.apache.spark:spark-sql_2.12:3.3.2'

errorProneOldest deps.build.errorProneCheckApiOld
errorProneOldest(deps.build.errorProneTestHelpersOld) {
Expand Down
25 changes: 25 additions & 0 deletions nullaway/src/test/java/com/uber/nullaway/NullAwayCoreTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -960,4 +960,29 @@ public void primitiveCastsRememberNullChecks() {
"}")
.doTest();
}

/**
* This test exposes a failure in CFG construction in Checker Framework 3.41.0 and above. Once a
* fix for this issue makes it to a Checker Framework release, we can probably remove this test.
* See https://github.com/typetools/checker-framework/issues/6396.
*/
@Test
public void cfgConstructionSymbolCompletionFailure() {
defaultCompilationHelper
.addSourceLines(
"Test.java",
"package com.uber;",
"import org.apache.spark.sql.SparkSession;",
"class Test {",
" static class X {",
" X(SparkSession session) {}",
" }",
" X run() {",
" try (SparkSession session = SparkSession.builder().getOrCreate()) {",
" return new X(session);",
" }",
" }",
"}")
.doTest();
}
}

0 comments on commit c7007fd

Please sign in to comment.