diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 6bcddffbd78..29d23c7d4a8 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -15,7 +15,7 @@ jobs:
# The dependsOn clauses are:
# * Everything depends on the canary jobs (the main jdk21 jobs), except those jobs themselves.
-# * Anything *_jdk11 or *_jdk17 or *_jdk22 depends on *_jdk21.
+# * Anything *_jdk11 or *_jdk17 or *_jdk23 depends on *_jdk21.
## TODO: Sometimes jdkXX jobs, for a previous non-LTS version (such as jdk20) are a bit gratuitous.
## They are placeholders for the next non-LTS version (such as jdk22) when it is released.
## Leaving those placeholders will ease the edits to this file.
@@ -29,7 +29,7 @@ jobs:
- typecheck_part1_jdk21
- typecheck_part2_jdk21
- misc_jdk21
- - misc_jdk22
+ - misc_jdk23
pool:
vmImage: 'ubuntu-latest'
steps:
@@ -72,12 +72,12 @@ jobs:
fetchDepth: 25
- bash: ./checker/bin-devel/test-cftests-junit.sh
displayName: test-cftests-junit.sh
-- job: junit_jdk22
+- job: junit_jdk23
dependsOn:
- canary_jobs
pool:
vmImage: 'ubuntu-latest'
- container: mdernst/cf-ubuntu-jdk22:latest
+ container: mdernst/cf-ubuntu-jdk23:latest
timeoutInMinutes: 70
steps:
- checkout: self
@@ -117,12 +117,12 @@ jobs:
fetchDepth: 25
- bash: ./checker/bin-devel/test-cftests-nonjunit.sh
displayName: test-cftests-nonjunit.sh
-- job: nonjunit_jdk22
+- job: nonjunit_jdk23
dependsOn:
- canary_jobs
pool:
vmImage: 'ubuntu-latest'
- container: mdernst/cf-ubuntu-jdk22:latest
+ container: mdernst/cf-ubuntu-jdk23:latest
steps:
- checkout: self
fetchDepth: 25
@@ -181,14 +181,14 @@ jobs:
fetchDepth: 25
- bash: ./checker/bin-devel/test-cftests-inference-part2.sh
displayName: test-cftests-inference-part2.sh
-- job: inference_jdk22
+- job: inference_jdk23
dependsOn:
- canary_jobs
- inference_part1_jdk21
- inference_part2_jdk21
pool:
vmImage: 'ubuntu-latest'
- container: mdernst/cf-ubuntu-jdk22:latest
+ container: mdernst/cf-ubuntu-jdk23:latest
timeoutInMinutes: 90
steps:
- checkout: self
@@ -227,10 +227,10 @@ jobs:
- bash: ./checker/bin-devel/test-misc.sh
displayName: test-misc.sh
# This is a canary job, so it has no `dependsOn`.
-- job: misc_jdk22
+- job: misc_jdk23
pool:
vmImage: 'ubuntu-latest'
- container: mdernst/cf-ubuntu-jdk22-plus:latest
+ container: mdernst/cf-ubuntu-jdk23-plus:latest
steps:
- checkout: self
fetchDepth: 25
@@ -281,14 +281,14 @@ jobs:
fetchDepth: 1000
- bash: ./checker/bin-devel/test-typecheck-part2.sh
displayName: test-typecheck-part2.sh
-- job: typecheck_jdk22
+- job: typecheck_jdk23
dependsOn:
- canary_jobs
- typecheck_part1_jdk21
- typecheck_part2_jdk21
pool:
vmImage: 'ubuntu-latest'
- container: mdernst/cf-ubuntu-jdk22-plus:latest
+ container: mdernst/cf-ubuntu-jdk23-plus:latest
steps:
- checkout: self
fetchDepth: 1000
@@ -346,14 +346,14 @@ jobs:
fetchDepth: 25
- bash: ./checker/bin-devel/test-daikon.sh
displayName: test-daikon-part2.sh
-- job: daikon_jdk22
+- job: daikon_jdk23
dependsOn:
- canary_jobs
- daikon_part1_jdk21
- daikon_part2_jdk21
pool:
vmImage: 'ubuntu-latest'
- container: mdernst/cf-ubuntu-jdk22:latest
+ container: mdernst/cf-ubuntu-jdk23:latest
timeoutInMinutes: 80
steps:
- checkout: self
@@ -404,13 +404,13 @@ jobs:
fetchDepth: 25
- bash: ./checker/bin-devel/test-guava.sh
displayName: test-guava.sh
-- job: guava_jdk22
+- job: guava_jdk23
dependsOn:
- canary_jobs
- guava_jdk21
pool:
vmImage: 'ubuntu-latest'
- container: mdernst/cf-ubuntu-jdk22:latest
+ container: mdernst/cf-ubuntu-jdk23:latest
timeoutInMinutes: 70
steps:
- checkout: self
@@ -452,13 +452,13 @@ jobs:
fetchDepth: 25
- bash: ./checker/bin-devel/test-plume-lib.sh
displayName: test-plume-lib.sh
-- job: plume_lib_jdk22
+- job: plume_lib_jdk23
dependsOn:
- canary_jobs
- plume_lib_jdk21
pool:
vmImage: 'ubuntu-latest'
- container: mdernst/cf-ubuntu-jdk22:latest
+ container: mdernst/cf-ubuntu-jdk23:latest
steps:
- checkout: self
fetchDepth: 25
@@ -500,13 +500,13 @@ jobs:
# fetchDepth: 25
# - bash: ./checker/bin-devel/test-downstream.sh
# displayName: test-downstream.sh
-# - job: downstream_jdk22
+# - job: downstream_jdk23
# dependsOn:
# - canary_jobs
# - downstream_jdk21
# pool:
# vmImage: 'ubuntu-latest'
-# container: mdernst/cf-ubuntu-jdk22:latest
+# container: mdernst/cf-ubuntu-jdk23:latest
# steps:
# - checkout: self
# fetchDepth: 25
diff --git a/checker/bin-devel/Dockerfile-README b/checker/bin-devel/Dockerfile-README
index 515b8e5475c..15394a81568 100644
--- a/checker/bin-devel/Dockerfile-README
+++ b/checker/bin-devel/Dockerfile-README
@@ -24,6 +24,7 @@ Create the Docker image:
DOCKERTESTING=""
# DOCKERTESTING="-testing"
alias create_upload_docker_image=' \
+ ( [ -z "$INSIDE_EMACS" ] || (echo "Do not run within Emacs" && false) ) && \
rm -rf dockerdir && \
mkdir -p dockerdir && \
(cd dockerdir && \
@@ -64,12 +65,12 @@ export DPROJECT=cf
create_upload_docker_image
export OS=ubuntu
-export JDKVER=jdk22
+export JDKVER=jdk23
export DPROJECT=cf
create_upload_docker_image
export OS=ubuntu
-export JDKVER=jdk22-plus
+export JDKVER=jdk23-plus
export DPROJECT=cf
create_upload_docker_image
diff --git a/checker/bin-devel/Dockerfile-ubuntu-jdk22 b/checker/bin-devel/Dockerfile-ubuntu-jdk23
similarity index 95%
rename from checker/bin-devel/Dockerfile-ubuntu-jdk22
rename to checker/bin-devel/Dockerfile-ubuntu-jdk23
index cb8314edad7..0f8c0ef962d 100644
--- a/checker/bin-devel/Dockerfile-ubuntu-jdk22
+++ b/checker/bin-devel/Dockerfile-ubuntu-jdk23
@@ -1,15 +1,15 @@
# Create a Docker image that is ready to run the main Checker Framework tests,
-# using JDK 22.
+# using JDK 23.
# (This is OpenJDK, not Oracle JDK. There are different instructions for
# installing a LTS release of Java.)
# To convert this file to use a newer JDK, search (from the top level of the
-# Checker Framework and Annotation Tools repositories) for: (java|jdk).?22\b
+# Checker Framework and Annotation Tools repositories) for: (java|jdk).?23\b
# "ubuntu" is the latest LTS release. "ubuntu:rolling" is the latest release.
# See releases at https://hub.docker.com/_/ubuntu for available images.
-# See https://packages.ubuntu.com/search?suite=default§ion=all&arch=any&keywords=openjdk-22-jdk&searchon=names
+# See https://packages.ubuntu.com/search?suite=default§ion=all&arch=any&keywords=openjdk-23-jdk&searchon=names
# to see what Ubuntu versions support a particular OpenJDK version.
-FROM ubuntu:mantic
+FROM ubuntu:oracular
MAINTAINER Michael Ernst Checker Framework developer manual
Making a Checker Framework release
+To upgrade the Checker Framework to use a newer version of Java: +
+ ++# Create a branch named "java-23". +cd $t/checker-framework-fork-mernst-branch-master +gnb java-23 +cd $t/checker-framework-fork-mernst-branch-java-23 + +# Edit: +checker/bin/wpi.sh +checker/bin/wpi-many.sh (diff it against wpi.sh) +# Rename and edit: +checker/bin-devel/Dockerfile-ubuntu-jdkXX +checker/bin-devel/Dockerfile-ubuntu-jdkXX-plus (diff it against Dockerfile-ubuntu-jdkXX) +# Further search for: (java|jdk).?22\b +# Don't push changes yet. + +# Use the latest version of Gradle, which supports the new JDK version +# (see https://docs.gradle.org/current/userguide/compatibility.html): +for wmtest in wpi-many-tests-bcel-util wpi-many-tests-bibtex-clean wpi-many-tests-ensures-called-methods wpi-many-tests-html-pretty-print wpi-many-tests-owning-field -wpi-many-tests-bibtex-clean ; do + cd $t/$wmtest && \ + (./gradlew wrapper --gradle-version 8.10 && ./gradlew build --warning-mode=all) && \ + git commit -m "Use Gradle 8.10" gradle/wrapper/gradle-wrapper.properties && \ + git push +done +# Now update file checker/tests/wpi-many/testin.txt. + +# Build the Docker images for the newest JDK version (others need not be rebuilt). + +# Push changes. Fix any build failures. ++ +
diff --git a/docs/examples/lombok/Makefile b/docs/examples/lombok/Makefile
index cd334d719ef..b2c0a7684a2 100644
--- a/docs/examples/lombok/Makefile
+++ b/docs/examples/lombok/Makefile
@@ -4,8 +4,8 @@ JAVA_VER := $(shell java -version 2>&1 | head -1 | cut -d'"' -f2 | sed '/^1\./s/
# Delomboking seems to mess up line numbers. The actual error is on line 13, but the error appears on line 12.
# So check for both the error message and make sure it is for the right assignment.
-# As of 2020-09-23, lombok does not work under Java 22, see https://projectlombok.org/changelog .
-ifeq (${JAVA_VER},22)
+# As of 2020-09-23, lombok does not work under Java 23, see https://projectlombok.org/changelog .
+ifeq (${JAVA_VER},23)
all:
@echo "Skipping test because lombok does not work under Java ${JAVA_VER}"
else
diff --git a/framework/src/main/java/org/checkerframework/framework/type/AnnotatedTypeFactory.java b/framework/src/main/java/org/checkerframework/framework/type/AnnotatedTypeFactory.java
index 3e605e09604..5186a251c49 100644
--- a/framework/src/main/java/org/checkerframework/framework/type/AnnotatedTypeFactory.java
+++ b/framework/src/main/java/org/checkerframework/framework/type/AnnotatedTypeFactory.java
@@ -283,6 +283,7 @@ public class AnnotatedTypeFactory implements AnnotationProvider {
protected QualifierHierarchy qualHierarchy;
/** Represent the type relations. */
+ // This field cannot be final because it is set in `postInit()`.
protected TypeHierarchy typeHierarchy;
/** Performs whole-program inference. If null, whole-program inference is disabled. */
diff --git a/javacutil/build.gradle b/javacutil/build.gradle
index 806b1963d55..fe2a25b6d81 100644
--- a/javacutil/build.gradle
+++ b/javacutil/build.gradle
@@ -15,6 +15,7 @@ dependencies {
// This is used by org.checkerframework.javacutil.TypesUtils.isImmutableTypeInJdk.
// https://mvnrepository.com/artifact/org.plumelib/plume-util
+ implementation "org.plumelib:hashmap-util:${versions.hashmapUtil}"
implementation "org.plumelib:plume-util:${versions.plumeUtil}"
implementation "org.plumelib:reflection-util:${versions.reflectionUtil}"
diff --git a/javacutil/src/main/java/org/checkerframework/javacutil/Resolver.java b/javacutil/src/main/java/org/checkerframework/javacutil/Resolver.java
index 77e7104ec16..3ca9369e714 100644
--- a/javacutil/src/main/java/org/checkerframework/javacutil/Resolver.java
+++ b/javacutil/src/main/java/org/checkerframework/javacutil/Resolver.java
@@ -65,6 +65,9 @@ public class Resolver {
/** Whether we are running on at least Java 13. */
private static final boolean atLeastJava13 = sourceVersionNumber >= 13;
+ /** Whether we are running on at least Java 23. */
+ private static final boolean atLeastJava23 = sourceVersionNumber >= 23;
+
static {
try {
FIND_METHOD =
@@ -79,7 +82,13 @@ public class Resolver {
boolean.class);
FIND_METHOD.setAccessible(true);
- FIND_VAR = Resolve.class.getDeclaredMethod("findVar", Env.class, Name.class);
+ if (atLeastJava23) {
+ FIND_VAR =
+ Resolve.class.getDeclaredMethod(
+ "findVar", DiagnosticPosition.class, Env.class, Name.class);
+ } else {
+ FIND_VAR = Resolve.class.getDeclaredMethod("findVar", Env.class, Name.class);
+ }
FIND_VAR.setAccessible(true);
if (atLeastJava13) {
@@ -128,7 +137,7 @@ public class Resolver {
FIND_TYPE.setAccessible(true);
} catch (Exception e) {
Error err =
- new AssertionError("Compiler 'Resolve' class doesn't contain required 'find' method");
+ new AssertionError("Compiler 'Resolve' class doesn't contain required 'find*' method");
err.initCause(e);
throw err;
}
@@ -275,7 +284,12 @@ public Env