Skip to content

Commit

Permalink
typetools/checker-framework 3.44.0 release (#1091)
Browse files Browse the repository at this point in the history
Co-authored-by: Suzanne Millstein <smillst@cs.washington.edu>
Co-authored-by: Michael Ernst <mernst@cs.washington.edu>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Sanjay Malakar <iamsanjaymalakar@gmail.com>
Co-authored-by: James Yoo <24359440+jyoo980@users.noreply.github.com>
Co-authored-by: Manu Sridharan <msridhar@gmail.com>
Co-authored-by: Martin Kellogg <martin.kellogg@njit.edu>
  • Loading branch information
8 people authored Feb 5, 2025
1 parent a450b3a commit 4f8ae14
Show file tree
Hide file tree
Showing 172 changed files with 1,960 additions and 751 deletions.
33 changes: 22 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def majorVersionToInt(majorVersionString) {
ext {
// Whether to use EISOP formatting.
// Can also be achieved by having a project property with the same name.
eisopFormatting = true
eisopFormatting = true || project.hasProperty('eisopFormatting')

// On a Java 8 JVM, use error-prone javac and source/target 8.
// On a Java 9+ JVM, use the host javac, default source/target, and required module flags.
Expand Down Expand Up @@ -162,7 +162,7 @@ allprojects { currentProj ->
// * any new checkers have been added, or
// * backward-incompatible changes have been made to APIs or elsewhere.
// To make a snapshot release: ./gradlew publish
version = '3.43.0'
version = '3.44.0'

tasks.withType(JavaCompile).configureEach {
options.fork = true
Expand Down Expand Up @@ -323,7 +323,7 @@ allprojects { currentProj ->
}
targetExclude doNotFormat

if (eisopFormatting || project.hasProperty('eisopFormatting')) {
if (eisopFormatting) {
googleJavaFormat(versions.googleJavaFormat).aosp()
importOrder('com', 'jdk', 'lib', 'lombok', 'org', 'java', 'javax')
} else {
Expand All @@ -338,7 +338,7 @@ allprojects { currentProj ->
target '**/*.gradle'
targetExclude doNotFormat
greclipse() // which formatter Spotless should use to format .gradle files.
if (eisopFormatting || project.hasProperty('eisopFormatting')) {
if (eisopFormatting) {
leadingTabsToSpaces(4)
} else {
leadingTabsToSpaces(2)
Expand Down Expand Up @@ -1162,9 +1162,10 @@ subprojects {
}
} catch (Exception ex) {
if (ex.getCause() != null && ex.getCause().getCause()!= null) {
String msg = ex.getCause().getLocalizedMessage() + ':\n'
msg += ex.getCause().getCause().getLocalizedMessage() + '\n'
msg += 'Have you installed jtreg?'
String msg = String.join(System.lineSeparator(),
ex.getCause().getLocalizedMessage() + ':',
ex.getCause().getCause().getLocalizedMessage(),
'Have you installed jtreg?')
println msg
}
throw ex
Expand Down Expand Up @@ -1193,24 +1194,34 @@ subprojects {
jvmArgs += compilerArgsForRunningCF
}

// maxParallelForks controls the parallelism of a single Test
// task. --parallel controls parallelism for the entire build.

// Run tests in parallel, except on CI where it seems to lead to flaky failures.
// The TF_BUILD environment variable is set to 'True' for jobs running on Azure Pipelines.
if (!System.getenv('TF_BUILD')?.equals('True')) {
// Not running under Azure Pipelines CI.

// This uses Gradle's recommended value for `maxParallelForks`:
// https://docs.gradle.org/current/userguide/performance.html#optimize_java_projects
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
maxParallelForks = Runtime.runtime.availableProcessors() ?: 1
} else {
// Running under Azure Pipelines CI.

// Per Manu's comment above, on CI, parallelism seems to lead to flaky failures.
maxParallelForks = 1

// Azure seems to time out when a task doesn't produce periodic output.
if (project.name.is('checker')) {
testLogging {
events "started", "skipped", "failed"
events "started", "skipped", "failed", "passed"
displayGranularity 3
}
}

// Fork the test to try to improve performance.
// https://docs.gradle.org/current/userguide/performance.html#fork_tests_into_multiple_processes
tasks.withType(Test).configureEach {
forkEvery = 25
}
}

if (project.name.is('checker')) {
Expand Down
18 changes: 10 additions & 8 deletions checker-qual-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,16 @@ final checkerQualAndroidPom(publication) {
publication.from components.java
publication.pom {
name = 'Checker Qual Android'
description = 'checker-qual-android contains annotations (type qualifiers) that a programmer\n' +
'writes to specify Java code for type-checking by the Checker Framework.\n' +
'\n' +
'The checker-qual-android artifact is identical to the checker-qual\n' +
'artifact, except that in checker-qual-android annotations have classfile\n' +
'retention. The default Android Gradle plugin retains types annotated with\n' +
'runtime annotations in the main dex, but strips out class-retention\n' +
'annotations.\n'
description =
String.join(System.lineSeparator(),
'checker-qual-android contains annotations (type qualifiers) that a programmer',
'writes to specify Java code for type-checking by the Checker Framework.',
'',
'The checker-qual-android artifact is identical to the checker-qual',
'artifact, except that in checker-qual-android annotations have classfile',
'retention. The default Android Gradle plugin retains types annotated with',
'runtime annotations in the main dex, but strips out class-retention',
'annotations.')
licenses {
license {
name = 'The MIT License'
Expand Down
5 changes: 3 additions & 2 deletions checker-qual/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ final checkerQualPom(publication) {
publication.from components.java
publication.pom {
name = 'Checker Qual'
description = 'checker-qual contains annotations (type qualifiers) that a programmer\n' +
'writes to specify Java code for type-checking by the Checker Framework.\n'
description = String.join(System.lineSeparator(),
'checker-qual contains annotations (type qualifiers) that a programmer' +
'writes to specify Java code for type-checking by the Checker Framework.')
licenses {
license {
name = 'The MIT License'
Expand Down
6 changes: 3 additions & 3 deletions checker/bin-devel/test-daikon-part1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ echo "running \"./gradlew assembleForJavac\" for checker-framework"
"$SCRIPTDIR/.git-scripts/git-clone-related" eisop-codespecs daikon
cd ../daikon
git log | head -n 5
make compile
make --jobs="$(getconf _NPROCESSORS_ONLN)" compile
if [ "$TRAVIS" = "true" ] ; then
# Travis kills a job if it runs 10 minutes without output
time make JAVACHECK_EXTRA_ARGS=-Afilenames -C java typecheck-part1
time make JAVACHECK_EXTRA_ARGS=-Afilenames -C java --jobs="$(getconf _NPROCESSORS_ONLN)" typecheck-part1
else
time make -C java typecheck-part1
time make -C java --jobs="$(getconf _NPROCESSORS_ONLN)" typecheck-part1
fi
6 changes: 3 additions & 3 deletions checker/bin-devel/test-daikon-part2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ echo "running \"./gradlew assembleForJavac\" for checker-framework"
"$SCRIPTDIR/.git-scripts/git-clone-related" eisop-codespecs daikon
cd ../daikon
git log | head -n 5
make compile
make --jobs="$(getconf _NPROCESSORS_ONLN)" compile
if [ "$TRAVIS" = "true" ] ; then
# Travis kills a job if it runs 10 minutes without output
time make JAVACHECK_EXTRA_ARGS=-Afilenames -C java typecheck-part2
time make JAVACHECK_EXTRA_ARGS=-Afilenames -C java --jobs="$(getconf _NPROCESSORS_ONLN)" typecheck-part2
else
time make -C java typecheck-part2
time make -C java --jobs="$(getconf _NPROCESSORS_ONLN)" typecheck-part2
fi
6 changes: 3 additions & 3 deletions checker/bin-devel/test-daikon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ echo "running \"./gradlew assembleForJavac\" for checker-framework"
"$SCRIPTDIR/.git-scripts/git-clone-related" eisop-codespecs daikon -q --single-branch --depth 50
cd ../daikon
git log | head -n 5
make compile
make --jobs="$(getconf _NPROCESSORS_ONLN)" compile
if [ "$TRAVIS" = "true" ] ; then
# Travis kills a job if it runs 10 minutes without output
time make JAVACHECK_EXTRA_ARGS=-Afilenames -C java typecheck
time make JAVACHECK_EXTRA_ARGS=-Afilenames -C java --jobs="$(getconf _NPROCESSORS_ONLN)" typecheck
else
time make -C java typecheck
time make -C java --jobs="$(getconf _NPROCESSORS_ONLN)" typecheck
fi
10 changes: 5 additions & 5 deletions checker/bin-devel/test-misc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ if grep -n -r --exclude-dir=build --exclude-dir=examples --exclude-dir=jtreg --e
echo "Don't use static import or wildcard import"
exit 1
fi
make -C checker/bin
make -C checker/bin-devel
make -C docs/developer/release check-python-style
make -C checker/bin --jobs="$(getconf _NPROCESSORS_ONLN)"
make -C checker/bin-devel --jobs="$(getconf _NPROCESSORS_ONLN)"
make -C docs/developer/release check-python-style --jobs="$(getconf _NPROCESSORS_ONLN)"

## HTML legality
./gradlew htmlValidate --console=plain --warning-mode=all
Expand All @@ -54,8 +54,8 @@ fi
if [ $status -ne 0 ]; then exit $status; fi

# Shell script style
make -C checker/bin shell-script-style
make -C checker/bin-devel shell-script-style
make -C checker/bin --jobs="$(getconf _NPROCESSORS_ONLN)" shell-script-style
make -C checker/bin-devel --jobs="$(getconf _NPROCESSORS_ONLN)" shell-script-style

## User documentation
./gradlew manual
Expand Down
14 changes: 8 additions & 6 deletions checker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -1171,12 +1171,14 @@ final checkerPom(publication) {
// Don't use publication.from components.java which would publish the skinny jar as checker.jar.
publication.pom {
name = 'Checker Framework'
description = 'The Checker Framework enhances Java\'s type system to\n' +
'make it more powerful and useful. This lets software developers\n' +
'detect and prevent errors in their Java programs.\n' +
'The Checker Framework includes compiler plug-ins ("checkers")\n' +
'that find bugs or verify their absence. It also permits you to\n' +
'write your own compiler plug-ins.'
description =
String.join(System.lineSeparator(),
'The Checker Framework enhances Java\'s type system to',
'make it more powerful and useful. This lets software developers',
'detect and prevent errors in their Java programs.',
'The Checker Framework includes compiler plug-ins ("checkers")',
'that find bugs or verify their absence. It also permits you to',
'write your own compiler plug-ins.')
licenses {
license {
name = 'GNU General Public License, version 2 (GPL2), with the classpath exception'
Expand Down
4 changes: 2 additions & 2 deletions checker/jtreg/index/ValueStubDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* @test
* @summary Test problem with aliasing LengthOf -> NonNegative and NonNegative -> IntRangeFromNonNegative
*
* @compile -XDrawDiagnostics -processor org.checkerframework.checker.index.IndexChecker valuestub/Test.java -Astubs=valuestub/Test.astub
* @compile -XDrawDiagnostics -processor org.checkerframework.checker.index.IndexChecker valuestub/UseTest.java
* @compile -processor org.checkerframework.checker.index.IndexChecker valuestub/Test.java -Astubs=valuestub/Test.astub
* @compile -processor org.checkerframework.checker.index.IndexChecker valuestub/UseTest.java
*/

public class ValueStubDriver {}
14 changes: 7 additions & 7 deletions checker/jtreg/issue469/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
* @summary Test that Issue 469 is fixed. Thanks to user pSub for the test case.
* @library .
*
* @compile -XDrawDiagnostics -processor org.checkerframework.checker.regex.RegexChecker simplecrash/CrashyInterface.java simplecrash/LetItCrash.java
* @compile -XDrawDiagnostics -processor org.checkerframework.checker.regex.RegexChecker simplecrash/LetItCrash.java simplecrash/CrashyInterface.java
* @compile -XDrawDiagnostics -processor org.checkerframework.checker.regex.RegexChecker simplecrash/CrashyInterface.java simplecrash/LetItCrash.java simplecrash/SomeRandomClass.java
* @compile -XDrawDiagnostics -processor org.checkerframework.checker.regex.RegexChecker simplecrash/LetItCrash.java simplecrash/CrashyInterface.java simplecrash/SomeRandomClass.java
* @compile -processor org.checkerframework.checker.regex.RegexChecker simplecrash/CrashyInterface.java simplecrash/LetItCrash.java
* @compile -processor org.checkerframework.checker.regex.RegexChecker simplecrash/LetItCrash.java simplecrash/CrashyInterface.java
* @compile -processor org.checkerframework.checker.regex.RegexChecker simplecrash/CrashyInterface.java simplecrash/LetItCrash.java simplecrash/SomeRandomClass.java
* @compile -processor org.checkerframework.checker.regex.RegexChecker simplecrash/LetItCrash.java simplecrash/CrashyInterface.java simplecrash/SomeRandomClass.java
*
* @compile -XDrawDiagnostics -processor org.checkerframework.checker.nullness.NullnessChecker advancedcrash/CrashyInterface.java advancedcrash/LetItCrash.java advancedcrash/SomeInterface.java
* @compile -XDrawDiagnostics -processor org.checkerframework.checker.nullness.NullnessChecker advancedcrash/LetItCrash.java advancedcrash/CrashyInterface.java advancedcrash/SomeInterface.java
* @compile -XDrawDiagnostics -processor org.checkerframework.checker.nullness.NullnessChecker advancedcrash/LetItCrash.java advancedcrash/SomeInterface.java advancedcrash/CrashyInterface.java
* @compile -processor org.checkerframework.checker.nullness.NullnessChecker advancedcrash/CrashyInterface.java advancedcrash/LetItCrash.java advancedcrash/SomeInterface.java
* @compile -processor org.checkerframework.checker.nullness.NullnessChecker advancedcrash/LetItCrash.java advancedcrash/CrashyInterface.java advancedcrash/SomeInterface.java
* @compile -processor org.checkerframework.checker.nullness.NullnessChecker advancedcrash/LetItCrash.java advancedcrash/SomeInterface.java advancedcrash/CrashyInterface.java
*/
public class Main {}
2 changes: 1 addition & 1 deletion checker/jtreg/nullness/AssignmentPerformanceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @test
* @summary Test case for issue #536: https://github.com/typetools/checker-framework/issues/536
*
* @compile/timeout=60 -XDrawDiagnostics -Xlint:unchecked -processor org.checkerframework.checker.nullness.NullnessChecker -Alint AssignmentPerformanceTest.java
* @compile/timeout=60 -Xlint:unchecked -processor org.checkerframework.checker.nullness.NullnessChecker -Alint AssignmentPerformanceTest.java
*/
public class AssignmentPerformanceTest {
private String s1;
Expand Down
4 changes: 2 additions & 2 deletions checker/jtreg/nullness/DefaultNonPublicClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* @summary Test that verifies defaults in a non-public class in the same
* file.
*
* @compile -XDrawDiagnostics -Xlint:unchecked -processor org.checkerframework.checker.nullness.NullnessChecker -Alint DefaultNonPublicClass.java
* @compile -XDrawDiagnostics -Xlint:unchecked -processor org.checkerframework.checker.nullness.NullnessChecker -Alint DefaultNonPublicClass.java
* @compile -Xlint:unchecked -processor org.checkerframework.checker.nullness.NullnessChecker -Alint DefaultNonPublicClass.java
* @compile -Xlint:unchecked -processor org.checkerframework.checker.nullness.NullnessChecker -Alint DefaultNonPublicClass.java
*/

import org.checkerframework.checker.nullness.qual.NonNull;
Expand Down
2 changes: 1 addition & 1 deletion checker/jtreg/nullness/Issue1438.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @test
* @summary Test case for issue #1438: https://github.com/typetools/checker-framework/issues/1438
*
* @compile/fail/timeout=90 -XDrawDiagnostics -Xlint:unchecked -processor org.checkerframework.checker.nullness.NullnessChecker -Alint Issue1438.java
* @compile/fail/timeout=90 -Xlint:unchecked -processor org.checkerframework.checker.nullness.NullnessChecker -Alint Issue1438.java
*/

import java.util.HashMap;
Expand Down
6 changes: 3 additions & 3 deletions checker/jtreg/nullness/Issue1809.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* https://github.com/typetools/checker-framework/issues/1809
* Also see framework/tests/all-systems/Issue1809.java
*
* @compile -XDrawDiagnostics -processor org.checkerframework.checker.nullness.NullnessChecker -AatfCacheSize=4 Issue1809.java
* @compile -XDrawDiagnostics -processor org.checkerframework.checker.nullness.NullnessChecker -AatfDoNotCache Issue1809.java
* @compile -XDrawDiagnostics -processor org.checkerframework.checker.nullness.NullnessChecker Issue1809.java
* @compile -processor org.checkerframework.checker.nullness.NullnessChecker -AatfCacheSize=4 Issue1809.java
* @compile -processor org.checkerframework.checker.nullness.NullnessChecker -AatfDoNotCache Issue1809.java
* @compile -processor org.checkerframework.checker.nullness.NullnessChecker Issue1809.java
*/

import java.util.List;
Expand Down
2 changes: 1 addition & 1 deletion checker/jtreg/nullness/Issue2853.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @test
* @summary Test case for issue #2853: https://github.com/typetools/checker-framework/issues/2853
*
* @compile/timeout=30 -XDrawDiagnostics -Xlint:unchecked -processor org.checkerframework.checker.nullness.NullnessChecker Issue2853.java
* @compile/timeout=30 -Xlint:unchecked -processor org.checkerframework.checker.nullness.NullnessChecker Issue2853.java
*/
public class Issue2853 {

Expand Down
2 changes: 1 addition & 1 deletion checker/jtreg/nullness/Issue347.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @test
* @summary Test for Issue 347: concurrent semantics has desired behavior
*
* @compile -XDrawDiagnostics -processor org.checkerframework.checker.nullness.NullnessChecker -Alint Issue347.java
* @compile -processor org.checkerframework.checker.nullness.NullnessChecker -Alint Issue347.java
* @compile/fail/ref=Issue347-con.out -XDrawDiagnostics -processor org.checkerframework.checker.nullness.NullnessChecker -Alint Issue347.java -AconcurrentSemantics
*/

Expand Down
2 changes: 1 addition & 1 deletion checker/jtreg/nullness/Issue4948.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @test
* @summary Test case for issue #4948: https://github.com/typetools/checker-framework/issues/4948
*
* @compile/timeout=30 -XDrawDiagnostics -Xlint:unchecked -processor org.checkerframework.checker.nullness.NullnessChecker -Alint Issue4948.java
* @compile/timeout=30 -Xlint:unchecked -processor org.checkerframework.checker.nullness.NullnessChecker -Alint Issue4948.java
*/
import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.checker.nullness.qual.PolyNull;
Expand Down
4 changes: 2 additions & 2 deletions checker/jtreg/nullness/annotationsOnExtends/Other.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* @test
* @summary Test for bug when storing annotations on extends or implements in class declarations in elements.
*
* @compile -XDrawDiagnostics -processor org.checkerframework.checker.nullness.NullnessChecker Test.java Test2.java Other.java
* @compile -XDrawDiagnostics -processor org.checkerframework.checker.nullness.NullnessChecker Other.java Test.java Test2.java
* @compile -processor org.checkerframework.checker.nullness.NullnessChecker Test.java Test2.java Other.java
* @compile -processor org.checkerframework.checker.nullness.NullnessChecker Other.java Test.java Test2.java
*/

public class Other {
Expand Down
2 changes: 1 addition & 1 deletion checker/jtreg/nullness/issue12/BinaryDefaultTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @summary Test the defaulting mechanism for nullness in binary files.
*
* @ignore Temporarily, until safe defaults for unannotated libraries are the default
* @compile -XDrawDiagnostics -Xlint:unchecked BinaryDefaultTestBinary.java
* @compile -Xlint:unchecked BinaryDefaultTestBinary.java
* @compile/fail/ref=BinaryDefaultTest.out -XDrawDiagnostics -Xlint:unchecked -processor org.checkerframework.checker.nullness.NullnessChecker BinaryDefaultTest.java
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* argument is expected.
*
* @ignore Temporarily, until safe defaults fon unannotated libraries are the default
* @compile -XDrawDiagnostics -Xlint:unchecked BinaryDefaultTestBinary.java
* @compile -Xlint:unchecked BinaryDefaultTestBinary.java
* @compile/fail/ref=BinaryDefaultTestWithStub.out -XDrawDiagnostics -Xlint:unchecked -Astubs=binary.astub -processor org.checkerframework.checker.nullness.NullnessChecker BinaryDefaultTest.java
*/

Expand Down
Loading

0 comments on commit 4f8ae14

Please sign in to comment.