Skip to content

Commit

Permalink
Merge branch 'master' into eisop-template
Browse files Browse the repository at this point in the history
  • Loading branch information
Ao-senXiong authored Dec 27, 2024
2 parents f17cd75 + 1c036e6 commit 26476eb
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ jobs:
java: [{version: '8', experimental: false},
{version: '11', experimental: false},
{version: '17', experimental: false},
{version: '22', experimental: true},
{version: '23-ea', experimental: true},
{version: '22', experimental: false},
{version: '23', experimental: false},
{version: '24-ea', experimental: true}]
env:
JAVA_VERSION: ${{ matrix.java.version }}
Expand Down
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ ext {
// The int corresponding to the major version of the current JVM.
currentRuntimeJavaVersion = majorVersionToInt(JavaVersion.current().getMajorVersion())

// As of 2024-08-06, delombok doesn't yet support JDK 23; see https://projectlombok.org/changelog .
skipDelombok = currentRuntimeJavaVersion >= 23
// As of 2024-12-24, delombok doesn't yet support JDK 24; see https://projectlombok.org/changelog .
// Keep in sync with check in docs/examples/lombok/Makefile
skipDelombok = currentRuntimeJavaVersion >= 24

parentDir = file("${rootDir}/../").absolutePath

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

// TODO: This pattern is valid starting with JDK 23. Decide how to handle version-specific
// issues.
// TODO :: error: (i18nformat.string.invalid)
// MessageFormat.format("{0, choice, 0##zero}", 0);

// good
MessageFormat.format("{0, number, #.#}", 1);
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/BazelExample/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
bazel_dep(name = "rules_jvm_external", version = "6.2")
bazel_dep(name = "rules_jvm_external", version = "6.6")
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
artifacts = [
Expand Down
10 changes: 4 additions & 6 deletions docs/examples/BazelExample/MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions docs/examples/BazelExample/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
JAVA_VER := $(shell java -version 2>&1 | head -1 | cut -d'"' -f2 | sed '/^1\./s///' | cut -d'.' -f1 | sed 's/-ea//')

.PHONY: all clean

ifeq ($(shell test $(JAVA_VER) -gt 21; echo $$?),0)
all:
@echo "Skipping test because I don't know how to configure bazel to work on a JDK > 21..."
else
all:
bazelisk run example > Out.txt 2>&1 || true
grep -qF "BazelExample.java:25: error: [assignment.type.incompatible] incompatible types in assignment." Out.txt || (echo "FAILURE. Here is file Out.txt:" && cat Out.txt && echo "End of file Out.txt." && false)
endif

clean:
-bazelisk clean
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/lombok/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 2023-09-23, lombok does not work under Java 22, see https://projectlombok.org/changelog .
ifeq (${JAVA_VER},22)
# As of 2024-12-24, lombok does not work under Java 24, see https://projectlombok.org/changelog .
ifeq ($(shell test $(JAVA_VER) -gt 23; echo $$?),0)
all:
@echo "Skipping test because lombok does not work under Java ${JAVA_VER}"
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
import org.checkerframework.javacutil.BugInCF;
import org.checkerframework.javacutil.ElementUtils;
import org.checkerframework.javacutil.TreeUtils;
import org.checkerframework.javacutil.TypesUtils;
import org.checkerframework.javacutil.UserError;
import org.plumelib.util.ArrayMap;
import org.plumelib.util.CollectionsPlume;
Expand Down Expand Up @@ -1990,11 +1991,7 @@ private void annotateTypeParameters(
}
if (param.getTypeBound().size() == 1
&& param.getTypeBound().get(0).getAnnotations().isEmpty()
&& paramType
.getUpperBound()
.getUnderlyingType()
.toString()
.contentEquals("java.lang.Object")) {
&& TypesUtils.isObject(paramType.getUpperBound().getUnderlyingType())) {
// If there is an explicit "T extends Object" type parameter bound,
// treat it like an explicit use of "Object" in code.
AnnotatedTypeMirror ub = atypeFactory.getAnnotatedType(Object.class);
Expand Down

0 comments on commit 26476eb

Please sign in to comment.