Skip to content
Closed
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
54 changes: 0 additions & 54 deletions .azure/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,34 +36,6 @@ jobs:
- bash: true
displayName: canary_jobs

- job: junit_jdk11
dependsOn:
- canary_jobs
- junit_part1_jdk25
- junit_part2_jdk25
pool:
vmImage: 'ubuntu-latest'
container: mdernst/cf-ubuntu-jdk11:latest
timeoutInMinutes: 70
steps:
- checkout: self
fetchDepth: 25
- bash: export ORG_GRADLE_PROJECT_jdkTestVersion=11 && ./checker/bin-devel/test-cftests-junit.sh
displayName: test-cftests-junit.sh
- job: junit_jdk17
dependsOn:
- canary_jobs
- junit_part1_jdk25
- junit_part2_jdk25
pool:
vmImage: 'ubuntu-latest'
container: mdernst/cf-ubuntu-jdk17:latest
timeoutInMinutes: 70
steps:
- checkout: self
fetchDepth: 25
- bash: export ORG_GRADLE_PROJECT_jdkTestVersion=17 && ./checker/bin-devel/test-cftests-junit.sh
displayName: test-cftests-junit.sh
- job: junit_jdk21
dependsOn:
- canary_jobs
Expand Down Expand Up @@ -135,32 +107,6 @@ jobs:
- bash: export ORG_GRADLE_PROJECT_jdkTestVersion=25 && ./checker/bin-devel/test-cftests-inference-part2.sh
displayName: test-cftests-inference-part2.sh

- job: misc_jdk11
dependsOn:
- canary_jobs
- misc_jdk25
pool:
vmImage: 'ubuntu-latest'
container: mdernst/cf-ubuntu-jdk11-plus:latest
steps:
- checkout: self
# Unlimited fetchDepth (0) for misc jobs, because of need to make contributors.tex.
fetchDepth: 0
- bash: export ORG_GRADLE_PROJECT_jdkTestVersion=11 && ./checker/bin-devel/test-misc.sh
displayName: test-misc.sh
- job: misc_jdk17
dependsOn:
- canary_jobs
- misc_jdk25
pool:
vmImage: 'ubuntu-latest'
container: mdernst/cf-ubuntu-jdk17-plus:latest
steps:
- checkout: self
# Unlimited fetchDepth (0) for misc jobs, because of need to make contributors.tex.
fetchDepth: 0
- bash: export ORG_GRADLE_PROJECT_jdkTestVersion=17 && ./checker/bin-devel/test-misc.sh
displayName: test-misc.sh
- job: misc_jdk21
dependsOn:
- canary_jobs
Expand Down
4 changes: 0 additions & 4 deletions .azure/jobs.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
junit_job(11)
junit_job(17)
junit_job(21)
junit_jobs(25)

Expand All @@ -11,8 +9,6 @@ nonjunit_job(canary_version)
# So use a timeout of 90 minutes, and hope that is enough.
inference_job(canary_version)

misc_job(11)
misc_job(17)
misc_job(21)
misc_job(25)

Expand Down
36 changes: 21 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@ allprojects { currentProj ->
if (!name.equals("javadocDoclintAll")) {
options.memberLevel = javadocMemberLevel
}
// Without the following, Javadoc will error on checker-qual with "error: reference not found"
// on class in checker.jar.
exclude "**/module-info.java"
Comment thread
smillst marked this conversation as resolved.
Resolved
classpath += configurations.named("checkerFatJar").get().asFileTree
options.taglets("org.checkerframework.taglet.ManualTaglet")
options.tagletPath(project(":framework-test").sourceSets.taglet.output.classesDirs.getFiles() as File[])
Expand Down Expand Up @@ -289,20 +292,16 @@ allprojects { currentProj ->
// Uncomment when needed.
// // Put source files in deterministic order, for debugging.
// compilationTask.source = compilationTask.source.sort()

// This test is for whether the Checker Framework supports (runs under) Java 8.
// Currently, the Checker Framework does support Java 8.
if (true) {
// Using `options.release.set(8)` here leads to compilation
// errors such as "package com.sun.source.tree does not exist".
sourceCompatibility = 8
targetCompatibility = 8
// Because the target is 8, all of the public compiler classes are accessible, so
// --add-exports are not required (nor are they allowed with target 8). See
// https://openjdk.org/jeps/247 for details on compiling for older versions.
if ((project.name.equals("checker-qual")
|| project.name.equals("checker-util")
|| project.name.equals("checker-qual-android"))) {
options.release = 11
} else {
// This makes the class files Java 11, and then the Checker Framework would not run under Java 8.
options.release.set(11)
sourceCompatibility = 21
targetCompatibility = 21
// Can't use --release with --add-exports, otherwise you'll see errors like:
// error: exporting a package from system module jdk.compiler is not allowed with --release
// options.release.set(21)
Comment thread
smillst marked this conversation as resolved.
Resolved
options.compilerArgs += [
"--add-exports",
"jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",
Expand Down Expand Up @@ -339,7 +338,6 @@ allprojects { currentProj ->
// via the setAccessible method of the core reflection API. The --add-opens option can
// be used, at run time, to do this."
}

options.failOnError = true
options.deprecation = true
// -options: To not get a warning about missing bootstrap classpath (when using Java 9 and `-source 8`).
Expand All @@ -365,6 +363,10 @@ allprojects { currentProj ->
options.errorprone.enabled = compilerRunsOnJava21orHigher
options.errorprone.disableWarningsInGeneratedCode = true
options.errorprone.errorproneArgs = [
// TODO: Fix these warnings now that JDK 21 is required.
"-Xep:StatementSwitchToExpressionSwitch:OFF",
// TODO: Fix these warnings now that JDK 21 is required.
"-Xep:PatternMatchingInstanceof:OFF",
Comment thread
smillst marked this conversation as resolved.
Resolved
// Many compiler classes are interned.
"-Xep:ReferenceEquality:OFF",
// Not useful to suggest Splitter; maybe clean up.
Expand Down Expand Up @@ -838,7 +840,11 @@ subprojects {
createCheckTypeTask(project.name, "Interning",
"org.checkerframework.checker.interning.InterningChecker",
[
"-Astubs=javax-lang-model-element-name.astub"
"-Astubs=javax-lang-model-element-name.astub",
// The stubparser gives a warning on the package, but the class is still found.
// warning: javax-lang-model-element-name.astub:(line 11,col 1): Package not found: com.sun.tools.javac.util
// 1 error
"-AstubNoWarnIfNotFound"
])
createCheckTypeTask(project.name, "Optional",
"org.checkerframework.checker.optional.OptionalChecker",
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ repositories {
}

java {
sourceCompatibility = '17'
targetCompatibility = '17'
sourceCompatibility = '21'
targetCompatibility = '21'
Comment thread
smillst marked this conversation as resolved.
Resolved
}

tasks.withType(Javadoc).configureEach {
Expand Down
1 change: 1 addition & 0 deletions checker-qual-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tasks.register("copySources", Copy) {
from(files(project(":checker-qual").sourceSets.main.java))
include("**/*.java")
exclude("**/SignednessUtilExtra.java")
exclude("**/module-info.java")

// Types annotated with runtime annotations are always kept in the main dex by the default Android Gradle plugin.
// Using the standard Checker Framework annotations can lead to main dex overflows;
Expand Down
24 changes: 0 additions & 24 deletions checker-qual/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,6 @@ plugins {
alias(libs.plugins.biz.aqute.bnd.builder)
}

sourceSets {
main {
java {
exclude("module-info.java")
}
}
module_info {
java {
srcDirs("src/main")
}
}
}

jar {
doLast {
copy {
Expand All @@ -29,17 +16,6 @@ jar {
}
}

tasks.register("compileJava9", JavaCompile) {
source = sourceSets.module_info.java
destinationDirectory = sourceSets.main.output.classesDirs[0]
classpath = configurations.allProjects
options.release = 9
}

compileJava {
dependsOn(compileJava9)
}

javadoc {
modularity.inferModulePath = false
}
Expand Down
19 changes: 18 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,24 @@
<!-- markdownlint-disable no-duplicate-heading -->
<!-- pyml disable no-duplicate-heading -->

## Version 3.54.1 (2026-04-02)
## Version 4.0.0 (2026-??)

### User-visible changes

To run the Checker Framework, you need to use a JDK 21 or later version of
javac. The Checker Framework can run on any Java project, including projects
that compile to Java 8, 11, or 17 bytecodes and run on JRE versions 8, 11, or
17.

The type qualifiers and utility libraries in `checker-qual.jar` and
`checker-util.jar` still use Java 11 bytecode. Thus, they may be included in
projects that run under an earlier version of Java.
Comment on lines +10 to +17

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# Find and examine build.gradle to check Java version configuration
find . -name "build.gradle*" -type f | head -20

Repository: typetools/checker-framework

Length of output: 445


🏁 Script executed:

# Check the current CHANGELOG.md content at lines 10-17
if [ -f "docs/CHANGELOG.md" ]; then
  sed -n '10,17p' docs/CHANGELOG.md
fi

Repository: typetools/checker-framework

Length of output: 504


🏁 Script executed:

# Get a broader view of the Version 4.0.0 section in CHANGELOG.md
if [ -f "docs/CHANGELOG.md" ]; then
  head -30 docs/CHANGELOG.md
fi

Repository: typetools/checker-framework

Length of output: 855


🏁 Script executed:

# Search for Java/release version configuration across build.gradle files
rg "options\.release|sourceCompatibility|targetCompatibility|version\s*=" -B2 -A2 --type gradle

Repository: typetools/checker-framework

Length of output: 2328


🏁 Script executed:

# Verify which Checker Framework artifacts are actually published/distributed
# Look for what gets published in the build configuration
rg "publishing|artifacts\s*{|jar\s*{" -A5 build.gradle | head -50

Repository: typetools/checker-framework

Length of output: 209


🏁 Script executed:

# Check if checker-qual-android is explicitly mentioned in build.gradle
rg "checker-qual-android" build.gradle -B3 -A3

Repository: typetools/checker-framework

Length of output: 834


Make the artifact compatibility break explicit and include the missing module.

This entry currently reads as though only the launcher moved to JDK 21 and the remaining jars still work on some unspecified "earlier" Java. In this PR, only checker-qual, checker-qual-android, and checker-util stay on Java 11 bytecode; the rest of the published artifacts now move to Java 21. The changelog omits checker-qual-android from the list and does not spell out that exception list, so downstream users may miss the actual breaking change.

Suggested wording
-To run the Checker Framework, you need to use a JDK 21 or later version of
-javac.  The Checker Framework can run on any Java project, including projects
-that compile to Java 8, 11, or 17 bytecodes and run on JRE versions 8, 11, or
-17.
-
-The type qualifiers and utility libraries in `checker-qual.jar` and
-`checker-util.jar` still use Java 11 bytecode.  Thus, they may be included in
-projects that run under an earlier version of Java.
+To run the Checker Framework, you need JDK 21 or later.  The Checker Framework
+can still analyze source code that targets older Java releases, such as
+`--release 8`, `11`, or `17`.
+
+Most Checker Framework artifacts now use Java 21 bytecode.  The exceptions are
+`checker-qual.jar`, `checker-qual-android.jar`, and `checker-util.jar`, which
+still use Java 11 bytecode.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
To run the Checker Framework, you need to use a JDK 21 or later version of
javac. The Checker Framework can run on any Java project, including projects
that compile to Java 8, 11, or 17 bytecodes and run on JRE versions 8, 11, or
17.
The type qualifiers and utility libraries in `checker-qual.jar` and
`checker-util.jar` still use Java 11 bytecode. Thus, they may be included in
projects that run under an earlier version of Java.
To run the Checker Framework, you need JDK 21 or later. The Checker Framework
can still analyze source code that targets older Java releases, such as
`--release 8`, `11`, or `17`.
Most Checker Framework artifacts now use Java 21 bytecode. The exceptions are
`checker-qual.jar`, `checker-qual-android.jar`, and `checker-util.jar`, which
still use Java 11 bytecode.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/CHANGELOG.md` around lines 10 - 17, The changelog entry is unclear about
which artifacts remain on Java 11 and which moved to JDK 21; update the
paragraph to explicitly state that all published artifacts now target Java 21
except for checker-qual, checker-qual-android, and checker-util which remain on
Java 11 bytecode, and mention that downstream users may need JDK 21 to run the
launcher and other artifacts; reference the existing terms "JDK 21",
"checker-qual.jar", "checker-qual-android", and "checker-util.jar" (or their
artifact names) when clarifying compatibility and the breaking change so readers
can immediately see the exception list and required Java versions.


### Implementation details

### Closed issues

## Version 3.54.1 (2026-04-01)

### User-visible changes

Expand Down
23 changes: 2 additions & 21 deletions docs/manual/creating-a-checker.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2318,22 +2318,6 @@
or String representation of the control flow graph of a given method in a given class.
The CFG is generated and output, but no dataflow analysis is performed.

\begin{itemize}

\item With JDK 8:

\begin{smaller}
\begin{Verbatim}
java -Xbootclasspath/p:$CHECKERFRAMEWORK/checker/dist/javac.jar \
-cp $CHECKERFRAMEWORK/checker/dist/checker.jar \
org.checkerframework.dataflow.cfg.visualize.CFGVisualizeLauncher \
MyClass.java --class MyClass --method test --pdf
\end{Verbatim}
\end{smaller}


\item With JDK 11 or later:

\begin{smaller}
\begin{Verbatim}
java -cp $CHECKERFRAMEWORK/checker/dist/checker.jar \
Expand All @@ -2342,18 +2326,15 @@
\end{Verbatim}
\end{smaller}

\end{itemize}

\noindent
The above command will generate the corresponding \<.dot> and \<.pdf> files for the
method \code{test} in the class \code{MyClass} in the project directory.
To generate a string representation of the graph to standard output,
remove \<--pdf> but add \<--string>. For example (with JDK 8):
remove \<--pdf> but add \<--string>. For example:

\begin{smaller}
\begin{Verbatim}
java -Xbootclasspath/p:$CHECKERFRAMEWORK/checker/dist/javac.jar \
-cp $CHECKERFRAMEWORK/checker/dist/checker.jar \
java -cp $CHECKERFRAMEWORK/checker/dist/checker.jar \
org.checkerframework.dataflow.cfg.visualize.CFGVisualizeLauncher \
MyClass.java --class MyClass --method test --string
\end{Verbatim}
Expand Down
Loading
Loading