Skip to content

Commit

Permalink
Support Java 23
Browse files Browse the repository at this point in the history
  • Loading branch information
mernst authored Sep 3, 2024
1 parent c16094b commit 87f9d44
Show file tree
Hide file tree
Showing 16 changed files with 128 additions and 69 deletions.
40 changes: 20 additions & 20 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -29,7 +29,7 @@ jobs:
- typecheck_part1_jdk21
- typecheck_part2_jdk21
- misc_jdk21
- misc_jdk22
- misc_jdk23
pool:
vmImage: 'ubuntu-latest'
steps:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions checker/bin-devel/Dockerfile-README
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand Down Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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&section=all&arch=any&keywords=openjdk-22-jdk&searchon=names
# See https://packages.ubuntu.com/search?suite=default&section=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 <mernst@cs.washington.edu>

# According to
Expand All @@ -31,7 +31,7 @@ RUN export DEBIAN_FRONTEND=noninteractive \
ca-certificates-java \
&& aptitude -y install \
openjdk-17-jdk \
openjdk-22-jdk
openjdk-23-jdk

# Known good combinations of JTReg and the JDK appear at https://builds.shipilev.net/jtreg/ .

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Create a Docker image that is ready to run the full Checker Framework tests,
# including building the manual and Javadoc, using JDK 22.
# including building the manual and Javadoc, 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&section=all&arch=any&keywords=openjdk-22-jdk&searchon=names
# See https://packages.ubuntu.com/search?suite=default&section=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 <mernst@cs.washington.edu>

# According to
Expand All @@ -31,7 +31,7 @@ RUN export DEBIAN_FRONTEND=noninteractive \
ca-certificates-java \
&& aptitude -y install \
openjdk-17-jdk \
openjdk-22-jdk
openjdk-23-jdk

# Known good combinations of JTReg and the JDK appear at https://builds.shipilev.net/jtreg/ .

Expand Down
24 changes: 12 additions & 12 deletions checker/bin/wpi-many.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ else
has_java21="yes"
fi

# shellcheck disable=SC2153 # testing for JAVA22_HOME, not a typo of JAVA_HOME
if [ "${JAVA22_HOME}" = "" ]; then
has_java22="no"
# shellcheck disable=SC2153 # testing for JAVA23_HOME, not a typo of JAVA_HOME
if [ "${JAVA23_HOME}" = "" ]; then
has_java23="no"
else
has_java22="yes"
has_java23="yes"
fi

if [ "${has_java_home}" = "yes" ] && [ ! -d "${JAVA_HOME}" ]; then
Expand All @@ -110,9 +110,9 @@ if [ "${has_java_home}" = "yes" ]; then
export JAVA21_HOME="${JAVA_HOME}"
has_java21="yes"
fi
if [ "${has_java22}" = "no" ] && [ "${java_version}" = 22 ]; then
export JAVA22_HOME="${JAVA_HOME}"
has_java22="yes"
if [ "${has_java23}" = "no" ] && [ "${java_version}" = 23 ]; then
export JAVA23_HOME="${JAVA_HOME}"
has_java23="yes"
fi
fi

Expand All @@ -136,23 +136,23 @@ if [ "${has_java21}" = "yes" ] && [ ! -d "${JAVA21_HOME}" ]; then
exit 1
fi

if [ "${has_java22}" = "yes" ] && [ ! -d "${JAVA22_HOME}" ]; then
echo "JAVA22_HOME is set to a non-existent directory ${JAVA22_HOME}"
if [ "${has_java23}" = "yes" ] && [ ! -d "${JAVA23_HOME}" ]; then
echo "JAVA23_HOME is set to a non-existent directory ${JAVA23_HOME}"
exit 1
fi

if [ "${has_java8}" = "no" ] && [ "${has_java11}" = "no" ] && [ "${has_java17}" = "no" ] && [ "${has_java21}" = "no" ] && [ "${has_java22}" = "no" ]; then
if [ "${has_java8}" = "no" ] && [ "${has_java11}" = "no" ] && [ "${has_java17}" = "no" ] && [ "${has_java21}" = "no" ] && [ "${has_java23}" = "no" ]; then
if [ "${has_java_home}" = "yes" ]; then
echo "Cannot determine Java version from JAVA_HOME"
else
echo "No Java 8, 11, 17, 21, or 22 JDKs found. At least one of JAVA_HOME, JAVA8_HOME, JAVA11_HOME, JAVA17_HOME, JAVA21_HOME, or JAVA22_HOME must be set."
echo "No Java 8, 11, 17, 21, or 23 JDKs found. At least one of JAVA_HOME, JAVA8_HOME, JAVA11_HOME, JAVA17_HOME, JAVA21_HOME, or JAVA23_HOME must be set."
fi
echo "JAVA_HOME = ${JAVA_HOME}"
echo "JAVA8_HOME = ${JAVA8_HOME}"
echo "JAVA11_HOME = ${JAVA11_HOME}"
echo "JAVA17_HOME = ${JAVA17_HOME}"
echo "JAVA21_HOME = ${JAVA21_HOME}"
echo "JAVA22_HOME = ${JAVA22_HOME}"
echo "JAVA23_HOME = ${JAVA23_HOME}"
command -v java
java -version
exit 1
Expand Down
24 changes: 12 additions & 12 deletions checker/bin/wpi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ else
has_java21="yes"
fi

# shellcheck disable=SC2153 # testing for JAVA22_HOME, not a typo of JAVA_HOME
if [ "${JAVA22_HOME}" = "" ]; then
has_java22="no"
# shellcheck disable=SC2153 # testing for JAVA23_HOME, not a typo of JAVA_HOME
if [ "${JAVA23_HOME}" = "" ]; then
has_java23="no"
else
has_java22="yes"
has_java23="yes"
fi

if [ "${has_java_home}" = "yes" ] && [ ! -d "${JAVA_HOME}" ]; then
Expand All @@ -105,9 +105,9 @@ if [ "${has_java_home}" = "yes" ]; then
export JAVA21_HOME="${JAVA_HOME}"
has_java21="yes"
fi
if [ "${has_java22}" = "no" ] && [ "${java_version}" = 22 ]; then
export JAVA22_HOME="${JAVA_HOME}"
has_java22="yes"
if [ "${has_java23}" = "no" ] && [ "${java_version}" = 23 ]; then
export JAVA23_HOME="${JAVA_HOME}"
has_java23="yes"
fi
fi

Expand All @@ -131,23 +131,23 @@ if [ "${has_java21}" = "yes" ] && [ ! -d "${JAVA21_HOME}" ]; then
exit 9
fi

if [ "${has_java22}" = "yes" ] && [ ! -d "${JAVA22_HOME}" ]; then
echo "JAVA22_HOME is set to a non-existent directory ${JAVA22_HOME}"
if [ "${has_java23}" = "yes" ] && [ ! -d "${JAVA23_HOME}" ]; then
echo "JAVA23_HOME is set to a non-existent directory ${JAVA23_HOME}"
exit 10
fi

if [ "${has_java8}" = "no" ] && [ "${has_java11}" = "no" ] && [ "${has_java17}" = "no" ] && [ "${has_java21}" = "no" ] && [ "${has_java22}" = "no" ]; then
if [ "${has_java8}" = "no" ] && [ "${has_java11}" = "no" ] && [ "${has_java17}" = "no" ] && [ "${has_java21}" = "no" ] && [ "${has_java23}" = "no" ]; then
if [ "${has_java_home}" = "yes" ]; then
echo "Cannot determine Java version from JAVA_HOME"
else
echo "No Java 8, 11, 17, 21, or 22 JDKs found. At least one of JAVA_HOME, JAVA8_HOME, JAVA11_HOME, JAVA17_HOME, JAVA21_HOME, or JAVA22_HOME must be set."
echo "No Java 8, 11, 17, 21, or 23 JDKs found. At least one of JAVA_HOME, JAVA8_HOME, JAVA11_HOME, JAVA17_HOME, JAVA21_HOME, or JAVA23_HOME must be set."
fi
echo "JAVA_HOME = ${JAVA_HOME}"
echo "JAVA8_HOME = ${JAVA8_HOME}"
echo "JAVA11_HOME = ${JAVA11_HOME}"
echo "JAVA17_HOME = ${JAVA17_HOME}"
echo "JAVA21_HOME = ${JAVA21_HOME}"
echo "JAVA22_HOME = ${JAVA22_HOME}"
echo "JAVA23_HOME = ${JAVA23_HOME}"
command -v java
java -version
exit 11
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ public Void visitVariable(VariableTree tree, Void p) {
* {@code x = Optional.of(Optional.of("baz"));}. However, the type of the right-hand side is
* {@code Optional<? extends Object>}, not {@code Optional<Optional<String>>}. Therefore, to fully
* check for improper types, it is necessary to examine, in the type checker, the argument to
* construction of an Optional. Method {@link handleNestedOptionalCreation} does so.
* construction of an Optional. Method {@link #handleNestedOptionalCreation} does so.
*/
private final class OptionalTypeValidator extends BaseTypeValidator {

Expand Down
5 changes: 3 additions & 2 deletions checker/tests/i18n-formatter/Syntax.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ public static void invalidSubformatPattern() {
MessageFormat.format("{0, number, #.#.#}", 1);
// :: error: (i18nformat.string)
MessageFormat.format("{0, date, y.m.d.x}", new Date());
// :: error: (i18nformat.string)
MessageFormat.format("{0, choice, 0##zero}", 0);
// This seems to be permitted by Java 23.
// // :: error: (i18nformat.string)
// MessageFormat.format("{0, choice, 0##zero}", 0);

// good
MessageFormat.format("{0, number, #.#}", 1);
Expand Down
10 changes: 5 additions & 5 deletions checker/tests/wpi-many/testin.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
https://github.com/kelloggm/wpi-many-tests-bcel-util a67f0cd3f59f621cffd0567306df55766f17550a
https://github.com/kelloggm/wpi-many-tests-bibtex-clean 43e0372475bf8d08522197b5b50196e8176b658b
https://github.com/kelloggm/wpi-many-tests-ensures-called-methods 5f39f1e5ad364900b5542438bae0a562db230d20
https://github.com/kelloggm/wpi-many-tests-html-pretty-print c3ce7959c68c1ecc40d8c85c31080bcc59f2854e
https://github.com/kelloggm/-wpi-many-tests-bibtex-clean 8e0d2c17240056ccd7d45efa272fb364aa482617
https://github.com/kelloggm/wpi-many-tests-bcel-util 91415634c1d47ada93de4fb9105bbd7817928a58
https://github.com/kelloggm/wpi-many-tests-bibtex-clean fe7ae9a276d8d392c174d497c14a7bf4f30876e8
https://github.com/kelloggm/wpi-many-tests-ensures-called-methods e5ad4c582392ee8edd8a6270b12aad876df94782
https://github.com/kelloggm/wpi-many-tests-html-pretty-print de5790094a1b3cece9cd97152a5c54afa615e6d9
https://github.com/kelloggm/-wpi-many-tests-bibtex-clean 4da53d845f91e5a34987f70227ec6e5b11e8fc60
# This comment line tests that the commenting feature works (if it doesn't, then this line will be read and fail, as it's not a URL).
https://github.com/Nargeshdb/wpi-many-tests-owning-field f446e987fdb87a4c8364c9a2728be70900cb30d5
2 changes: 2 additions & 0 deletions dataflow/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ dependencies {
// Node implements org.plumelib.util.UniqueId, so this dependency must be "api".
api "org.plumelib:plume-util:${versions.plumeUtil}"

implementation "org.plumelib:hashmap-util:${versions.hashmapUtil}"

// External dependencies:
// If you add an external dependency, you must shadow its packages both in the dataflow-shaded
// artifact (see shadowJar block below) and also in checker.jar (see the comment in
Expand Down
Loading

0 comments on commit 87f9d44

Please sign in to comment.