Skip to content

Commit 964c696

Browse files
authored
typetools/checker-framework 3.44.0 release (#1092)
2 parents a450b3a + 7ab69ad commit 964c696

File tree

171 files changed

+1953
-747
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

171 files changed

+1953
-747
lines changed

build.gradle

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def majorVersionToInt(majorVersionString) {
4444
ext {
4545
// Whether to use EISOP formatting.
4646
// Can also be achieved by having a project property with the same name.
47-
eisopFormatting = true
47+
eisopFormatting = true || project.hasProperty('eisopFormatting')
4848

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

167167
tasks.withType(JavaCompile).configureEach {
168168
options.fork = true
@@ -323,7 +323,7 @@ allprojects { currentProj ->
323323
}
324324
targetExclude doNotFormat
325325

326-
if (eisopFormatting || project.hasProperty('eisopFormatting')) {
326+
if (eisopFormatting) {
327327
googleJavaFormat(versions.googleJavaFormat).aosp()
328328
importOrder('com', 'jdk', 'lib', 'lombok', 'org', 'java', 'javax')
329329
} else {
@@ -338,7 +338,7 @@ allprojects { currentProj ->
338338
target '**/*.gradle'
339339
targetExclude doNotFormat
340340
greclipse() // which formatter Spotless should use to format .gradle files.
341-
if (eisopFormatting || project.hasProperty('eisopFormatting')) {
341+
if (eisopFormatting) {
342342
leadingTabsToSpaces(4)
343343
} else {
344344
leadingTabsToSpaces(2)
@@ -1162,9 +1162,10 @@ subprojects {
11621162
}
11631163
} catch (Exception ex) {
11641164
if (ex.getCause() != null && ex.getCause().getCause()!= null) {
1165-
String msg = ex.getCause().getLocalizedMessage() + ':\n'
1166-
msg += ex.getCause().getCause().getLocalizedMessage() + '\n'
1167-
msg += 'Have you installed jtreg?'
1165+
String msg = String.join(System.lineSeparator(),
1166+
ex.getCause().getLocalizedMessage() + ':',
1167+
ex.getCause().getCause().getLocalizedMessage(),
1168+
'Have you installed jtreg?')
11681169
println msg
11691170
}
11701171
throw ex
@@ -1193,24 +1194,34 @@ subprojects {
11931194
jvmArgs += compilerArgsForRunningCF
11941195
}
11951196

1197+
// maxParallelForks controls the parallelism of a single Test
1198+
// task. --parallel controls parallelism for the entire build.
1199+
11961200
// Run tests in parallel, except on CI where it seems to lead to flaky failures.
11971201
// The TF_BUILD environment variable is set to 'True' for jobs running on Azure Pipelines.
11981202
if (!System.getenv('TF_BUILD')?.equals('True')) {
11991203
// Not running under Azure Pipelines CI.
12001204

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

1209+
// Per Manu's comment above, on CI, parallelism seems to lead to flaky failures.
1210+
maxParallelForks = 1
1211+
12071212
// Azure seems to time out when a task doesn't produce periodic output.
12081213
if (project.name.is('checker')) {
12091214
testLogging {
1210-
events "started", "skipped", "failed"
1215+
events "started", "skipped", "failed", "passed"
12111216
displayGranularity 3
12121217
}
12131218
}
1219+
1220+
// Fork the test to try to improve performance.
1221+
// https://docs.gradle.org/current/userguide/performance.html#fork_tests_into_multiple_processes
1222+
tasks.withType(Test).configureEach {
1223+
forkEvery = 25
1224+
}
12141225
}
12151226

12161227
if (project.name.is('checker')) {

checker-qual-android/build.gradle

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,16 @@ final checkerQualAndroidPom(publication) {
4242
publication.from components.java
4343
publication.pom {
4444
name = 'Checker Qual Android'
45-
description = 'checker-qual-android contains annotations (type qualifiers) that a programmer\n' +
46-
'writes to specify Java code for type-checking by the Checker Framework.\n' +
47-
'\n' +
48-
'The checker-qual-android artifact is identical to the checker-qual\n' +
49-
'artifact, except that in checker-qual-android annotations have classfile\n' +
50-
'retention. The default Android Gradle plugin retains types annotated with\n' +
51-
'runtime annotations in the main dex, but strips out class-retention\n' +
52-
'annotations.\n'
45+
description =
46+
String.join(System.lineSeparator(),
47+
'checker-qual-android contains annotations (type qualifiers) that a programmer',
48+
'writes to specify Java code for type-checking by the Checker Framework.',
49+
'',
50+
'The checker-qual-android artifact is identical to the checker-qual',
51+
'artifact, except that in checker-qual-android annotations have classfile',
52+
'retention. The default Android Gradle plugin retains types annotated with',
53+
'runtime annotations in the main dex, but strips out class-retention',
54+
'annotations.')
5355
licenses {
5456
license {
5557
name = 'The MIT License'

checker-qual/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ final checkerQualPom(publication) {
6060
publication.from components.java
6161
publication.pom {
6262
name = 'Checker Qual'
63-
description = 'checker-qual contains annotations (type qualifiers) that a programmer\n' +
64-
'writes to specify Java code for type-checking by the Checker Framework.\n'
63+
description = String.join(System.lineSeparator(),
64+
'checker-qual contains annotations (type qualifiers) that a programmer' +
65+
'writes to specify Java code for type-checking by the Checker Framework.')
6566
licenses {
6667
license {
6768
name = 'The MIT License'

checker/bin-devel/test-daikon-part1.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ echo "running \"./gradlew assembleForJavac\" for checker-framework"
1818
"$SCRIPTDIR/.git-scripts/git-clone-related" eisop-codespecs daikon
1919
cd ../daikon
2020
git log | head -n 5
21-
make compile
21+
make --jobs="$(getconf _NPROCESSORS_ONLN)" compile
2222
if [ "$TRAVIS" = "true" ] ; then
2323
# Travis kills a job if it runs 10 minutes without output
24-
time make JAVACHECK_EXTRA_ARGS=-Afilenames -C java typecheck-part1
24+
time make JAVACHECK_EXTRA_ARGS=-Afilenames -C java --jobs="$(getconf _NPROCESSORS_ONLN)" typecheck-part1
2525
else
26-
time make -C java typecheck-part1
26+
time make -C java --jobs="$(getconf _NPROCESSORS_ONLN)" typecheck-part1
2727
fi

checker/bin-devel/test-daikon-part2.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ echo "running \"./gradlew assembleForJavac\" for checker-framework"
1717
"$SCRIPTDIR/.git-scripts/git-clone-related" eisop-codespecs daikon
1818
cd ../daikon
1919
git log | head -n 5
20-
make compile
20+
make --jobs="$(getconf _NPROCESSORS_ONLN)" compile
2121
if [ "$TRAVIS" = "true" ] ; then
2222
# Travis kills a job if it runs 10 minutes without output
23-
time make JAVACHECK_EXTRA_ARGS=-Afilenames -C java typecheck-part2
23+
time make JAVACHECK_EXTRA_ARGS=-Afilenames -C java --jobs="$(getconf _NPROCESSORS_ONLN)" typecheck-part2
2424
else
25-
time make -C java typecheck-part2
25+
time make -C java --jobs="$(getconf _NPROCESSORS_ONLN)" typecheck-part2
2626
fi

checker/bin-devel/test-daikon.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ echo "running \"./gradlew assembleForJavac\" for checker-framework"
1717
"$SCRIPTDIR/.git-scripts/git-clone-related" eisop-codespecs daikon -q --single-branch --depth 50
1818
cd ../daikon
1919
git log | head -n 5
20-
make compile
20+
make --jobs="$(getconf _NPROCESSORS_ONLN)" compile
2121
if [ "$TRAVIS" = "true" ] ; then
2222
# Travis kills a job if it runs 10 minutes without output
23-
time make JAVACHECK_EXTRA_ARGS=-Afilenames -C java typecheck
23+
time make JAVACHECK_EXTRA_ARGS=-Afilenames -C java --jobs="$(getconf _NPROCESSORS_ONLN)" typecheck
2424
else
25-
time make -C java typecheck
25+
time make -C java --jobs="$(getconf _NPROCESSORS_ONLN)" typecheck
2626
fi

checker/bin-devel/test-misc.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ if grep -n -r --exclude-dir=build --exclude-dir=examples --exclude-dir=jtreg --e
3030
echo "Don't use static import or wildcard import"
3131
exit 1
3232
fi
33-
make -C checker/bin
34-
make -C checker/bin-devel
35-
make -C docs/developer/release check-python-style
33+
make -C checker/bin --jobs="$(getconf _NPROCESSORS_ONLN)"
34+
make -C checker/bin-devel --jobs="$(getconf _NPROCESSORS_ONLN)"
35+
make -C docs/developer/release check-python-style --jobs="$(getconf _NPROCESSORS_ONLN)"
3636

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

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

6060
## User documentation
6161
./gradlew manual

checker/build.gradle

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,12 +1171,14 @@ final checkerPom(publication) {
11711171
// Don't use publication.from components.java which would publish the skinny jar as checker.jar.
11721172
publication.pom {
11731173
name = 'Checker Framework'
1174-
description = 'The Checker Framework enhances Java\'s type system to\n' +
1175-
'make it more powerful and useful. This lets software developers\n' +
1176-
'detect and prevent errors in their Java programs.\n' +
1177-
'The Checker Framework includes compiler plug-ins ("checkers")\n' +
1178-
'that find bugs or verify their absence. It also permits you to\n' +
1179-
'write your own compiler plug-ins.'
1174+
description =
1175+
String.join(System.lineSeparator(),
1176+
'The Checker Framework enhances Java\'s type system to',
1177+
'make it more powerful and useful. This lets software developers',
1178+
'detect and prevent errors in their Java programs.',
1179+
'The Checker Framework includes compiler plug-ins ("checkers")',
1180+
'that find bugs or verify their absence. It also permits you to',
1181+
'write your own compiler plug-ins.')
11801182
licenses {
11811183
license {
11821184
name = 'GNU General Public License, version 2 (GPL2), with the classpath exception'

checker/jtreg/index/ValueStubDriver.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
* @test
33
* @summary Test problem with aliasing LengthOf -> NonNegative and NonNegative -> IntRangeFromNonNegative
44
*
5-
* @compile -XDrawDiagnostics -processor org.checkerframework.checker.index.IndexChecker valuestub/Test.java -Astubs=valuestub/Test.astub
6-
* @compile -XDrawDiagnostics -processor org.checkerframework.checker.index.IndexChecker valuestub/UseTest.java
5+
* @compile -processor org.checkerframework.checker.index.IndexChecker valuestub/Test.java -Astubs=valuestub/Test.astub
6+
* @compile -processor org.checkerframework.checker.index.IndexChecker valuestub/UseTest.java
77
*/
88

99
public class ValueStubDriver {}

checker/jtreg/issue469/Main.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
* @summary Test that Issue 469 is fixed. Thanks to user pSub for the test case.
44
* @library .
55
*
6-
* @compile -XDrawDiagnostics -processor org.checkerframework.checker.regex.RegexChecker simplecrash/CrashyInterface.java simplecrash/LetItCrash.java
7-
* @compile -XDrawDiagnostics -processor org.checkerframework.checker.regex.RegexChecker simplecrash/LetItCrash.java simplecrash/CrashyInterface.java
8-
* @compile -XDrawDiagnostics -processor org.checkerframework.checker.regex.RegexChecker simplecrash/CrashyInterface.java simplecrash/LetItCrash.java simplecrash/SomeRandomClass.java
9-
* @compile -XDrawDiagnostics -processor org.checkerframework.checker.regex.RegexChecker simplecrash/LetItCrash.java simplecrash/CrashyInterface.java simplecrash/SomeRandomClass.java
6+
* @compile -processor org.checkerframework.checker.regex.RegexChecker simplecrash/CrashyInterface.java simplecrash/LetItCrash.java
7+
* @compile -processor org.checkerframework.checker.regex.RegexChecker simplecrash/LetItCrash.java simplecrash/CrashyInterface.java
8+
* @compile -processor org.checkerframework.checker.regex.RegexChecker simplecrash/CrashyInterface.java simplecrash/LetItCrash.java simplecrash/SomeRandomClass.java
9+
* @compile -processor org.checkerframework.checker.regex.RegexChecker simplecrash/LetItCrash.java simplecrash/CrashyInterface.java simplecrash/SomeRandomClass.java
1010
*
11-
* @compile -XDrawDiagnostics -processor org.checkerframework.checker.nullness.NullnessChecker advancedcrash/CrashyInterface.java advancedcrash/LetItCrash.java advancedcrash/SomeInterface.java
12-
* @compile -XDrawDiagnostics -processor org.checkerframework.checker.nullness.NullnessChecker advancedcrash/LetItCrash.java advancedcrash/CrashyInterface.java advancedcrash/SomeInterface.java
13-
* @compile -XDrawDiagnostics -processor org.checkerframework.checker.nullness.NullnessChecker advancedcrash/LetItCrash.java advancedcrash/SomeInterface.java advancedcrash/CrashyInterface.java
11+
* @compile -processor org.checkerframework.checker.nullness.NullnessChecker advancedcrash/CrashyInterface.java advancedcrash/LetItCrash.java advancedcrash/SomeInterface.java
12+
* @compile -processor org.checkerframework.checker.nullness.NullnessChecker advancedcrash/LetItCrash.java advancedcrash/CrashyInterface.java advancedcrash/SomeInterface.java
13+
* @compile -processor org.checkerframework.checker.nullness.NullnessChecker advancedcrash/LetItCrash.java advancedcrash/SomeInterface.java advancedcrash/CrashyInterface.java
1414
*/
1515
public class Main {}

checker/jtreg/nullness/AssignmentPerformanceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @test
33
* @summary Test case for issue #536: https://github.com/typetools/checker-framework/issues/536
44
*
5-
* @compile/timeout=60 -XDrawDiagnostics -Xlint:unchecked -processor org.checkerframework.checker.nullness.NullnessChecker -Alint AssignmentPerformanceTest.java
5+
* @compile/timeout=60 -Xlint:unchecked -processor org.checkerframework.checker.nullness.NullnessChecker -Alint AssignmentPerformanceTest.java
66
*/
77
public class AssignmentPerformanceTest {
88
private String s1;

checker/jtreg/nullness/DefaultNonPublicClass.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
* @summary Test that verifies defaults in a non-public class in the same
44
* file.
55
*
6-
* @compile -XDrawDiagnostics -Xlint:unchecked -processor org.checkerframework.checker.nullness.NullnessChecker -Alint DefaultNonPublicClass.java
7-
* @compile -XDrawDiagnostics -Xlint:unchecked -processor org.checkerframework.checker.nullness.NullnessChecker -Alint DefaultNonPublicClass.java
6+
* @compile -Xlint:unchecked -processor org.checkerframework.checker.nullness.NullnessChecker -Alint DefaultNonPublicClass.java
7+
* @compile -Xlint:unchecked -processor org.checkerframework.checker.nullness.NullnessChecker -Alint DefaultNonPublicClass.java
88
*/
99

1010
import org.checkerframework.checker.nullness.qual.NonNull;

checker/jtreg/nullness/Issue1438.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @test
33
* @summary Test case for issue #1438: https://github.com/typetools/checker-framework/issues/1438
44
*
5-
* @compile/fail/timeout=90 -XDrawDiagnostics -Xlint:unchecked -processor org.checkerframework.checker.nullness.NullnessChecker -Alint Issue1438.java
5+
* @compile/fail/timeout=90 -Xlint:unchecked -processor org.checkerframework.checker.nullness.NullnessChecker -Alint Issue1438.java
66
*/
77

88
import java.util.HashMap;

checker/jtreg/nullness/Issue1809.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
* https://github.com/typetools/checker-framework/issues/1809
55
* Also see framework/tests/all-systems/Issue1809.java
66
*
7-
* @compile -XDrawDiagnostics -processor org.checkerframework.checker.nullness.NullnessChecker -AatfCacheSize=4 Issue1809.java
8-
* @compile -XDrawDiagnostics -processor org.checkerframework.checker.nullness.NullnessChecker -AatfDoNotCache Issue1809.java
9-
* @compile -XDrawDiagnostics -processor org.checkerframework.checker.nullness.NullnessChecker Issue1809.java
7+
* @compile -processor org.checkerframework.checker.nullness.NullnessChecker -AatfCacheSize=4 Issue1809.java
8+
* @compile -processor org.checkerframework.checker.nullness.NullnessChecker -AatfDoNotCache Issue1809.java
9+
* @compile -processor org.checkerframework.checker.nullness.NullnessChecker Issue1809.java
1010
*/
1111

1212
import java.util.List;

checker/jtreg/nullness/Issue2853.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @test
33
* @summary Test case for issue #2853: https://github.com/typetools/checker-framework/issues/2853
44
*
5-
* @compile/timeout=30 -XDrawDiagnostics -Xlint:unchecked -processor org.checkerframework.checker.nullness.NullnessChecker Issue2853.java
5+
* @compile/timeout=30 -Xlint:unchecked -processor org.checkerframework.checker.nullness.NullnessChecker Issue2853.java
66
*/
77
public class Issue2853 {
88

checker/jtreg/nullness/Issue347.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @test
33
* @summary Test for Issue 347: concurrent semantics has desired behavior
44
*
5-
* @compile -XDrawDiagnostics -processor org.checkerframework.checker.nullness.NullnessChecker -Alint Issue347.java
5+
* @compile -processor org.checkerframework.checker.nullness.NullnessChecker -Alint Issue347.java
66
* @compile/fail/ref=Issue347-con.out -XDrawDiagnostics -processor org.checkerframework.checker.nullness.NullnessChecker -Alint Issue347.java -AconcurrentSemantics
77
*/
88

checker/jtreg/nullness/Issue4948.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @test
33
* @summary Test case for issue #4948: https://github.com/typetools/checker-framework/issues/4948
44
*
5-
* @compile/timeout=30 -XDrawDiagnostics -Xlint:unchecked -processor org.checkerframework.checker.nullness.NullnessChecker -Alint Issue4948.java
5+
* @compile/timeout=30 -Xlint:unchecked -processor org.checkerframework.checker.nullness.NullnessChecker -Alint Issue4948.java
66
*/
77
import org.checkerframework.checker.nullness.qual.Nullable;
88
import org.checkerframework.checker.nullness.qual.PolyNull;

checker/jtreg/nullness/annotationsOnExtends/Other.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
* @test
33
* @summary Test for bug when storing annotations on extends or implements in class declarations in elements.
44
*
5-
* @compile -XDrawDiagnostics -processor org.checkerframework.checker.nullness.NullnessChecker Test.java Test2.java Other.java
6-
* @compile -XDrawDiagnostics -processor org.checkerframework.checker.nullness.NullnessChecker Other.java Test.java Test2.java
5+
* @compile -processor org.checkerframework.checker.nullness.NullnessChecker Test.java Test2.java Other.java
6+
* @compile -processor org.checkerframework.checker.nullness.NullnessChecker Other.java Test.java Test2.java
77
*/
88

99
public class Other {

checker/jtreg/nullness/issue12/BinaryDefaultTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @summary Test the defaulting mechanism for nullness in binary files.
44
*
55
* @ignore Temporarily, until safe defaults for unannotated libraries are the default
6-
* @compile -XDrawDiagnostics -Xlint:unchecked BinaryDefaultTestBinary.java
6+
* @compile -Xlint:unchecked BinaryDefaultTestBinary.java
77
* @compile/fail/ref=BinaryDefaultTest.out -XDrawDiagnostics -Xlint:unchecked -processor org.checkerframework.checker.nullness.NullnessChecker BinaryDefaultTest.java
88
*/
99

checker/jtreg/nullness/issue12/BinaryDefaultTestWithStub.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* argument is expected.
66
*
77
* @ignore Temporarily, until safe defaults fon unannotated libraries are the default
8-
* @compile -XDrawDiagnostics -Xlint:unchecked BinaryDefaultTestBinary.java
8+
* @compile -Xlint:unchecked BinaryDefaultTestBinary.java
99
* @compile/fail/ref=BinaryDefaultTestWithStub.out -XDrawDiagnostics -Xlint:unchecked -Astubs=binary.astub -processor org.checkerframework.checker.nullness.NullnessChecker BinaryDefaultTest.java
1010
*/
1111

0 commit comments

Comments
 (0)