diff --git a/checker-util/src/main/java/org/checkerframework/checker/signedness/util/SignednessUtil.java b/checker-util/src/main/java/org/checkerframework/checker/signedness/util/SignednessUtil.java index 1d8d18996c7..fb768ab3fd6 100644 --- a/checker-util/src/main/java/org/checkerframework/checker/signedness/util/SignednessUtil.java +++ b/checker-util/src/main/java/org/checkerframework/checker/signedness/util/SignednessUtil.java @@ -398,7 +398,7 @@ public static String toUnsignedString(@Unsigned byte b, int radix) { } /** - * Creates a BigInteger representing the same value as unsigned long. + * Creates a BigInteger representing the same value as an unsigned long. * *

Java provides no public method with this functionality, unfortunately. * @@ -406,7 +406,6 @@ public static String toUnsignedString(@Unsigned byte b, int radix) { * @return the corresponding BigInteger */ @SuppressWarnings("signedness") - @Deprecated(forRemoval = true, since = "4.0.0") private static @Unsigned BigInteger toUnsignedBigInteger(@Unsigned long l) { if (l >= 0L) { return BigInteger.valueOf(l); diff --git a/checker/bin-devel/build.sh b/checker/bin-devel/build.sh deleted file mode 100755 index f87dcb8cd31..00000000000 --- a/checker/bin-devel/build.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -echo Entering checker/bin-devel/build.sh in "$(pwd)" -echo checker/bin-devel/build.sh is deprecated: use ./gradlew assemble instead. - -# Fail the whole script if any command fails -set -e - -SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)" -source "$SCRIPT_DIR"/clone-related.sh - -echo "running \"./gradlew assemble\" for checker-framework" -./gradlew assemble -Dorg.gradle.internal.http.socketTimeout=60000 -Dorg.gradle.internal.http.connectionTimeout=60000 - -echo Exiting checker/bin-devel/build.sh in "$(pwd)" diff --git a/checker/src/main/java/org/checkerframework/checker/calledmethods/CalledMethodsChecker.java b/checker/src/main/java/org/checkerframework/checker/calledmethods/CalledMethodsChecker.java index fec9cf28cde..94969c6ee8e 100644 --- a/checker/src/main/java/org/checkerframework/checker/calledmethods/CalledMethodsChecker.java +++ b/checker/src/main/java/org/checkerframework/checker/calledmethods/CalledMethodsChecker.java @@ -8,21 +8,12 @@ import org.checkerframework.framework.qual.StubFiles; import org.checkerframework.framework.source.SourceChecker; import org.checkerframework.framework.source.SupportedOptions; -import org.checkerframework.framework.source.SuppressWarningsPrefix; /** * The Called Methods Checker tracks the methods that have definitely been called on an object. One * common use case for the Called Methods Checker is to specify safe combinations of options to * builder or builder-like interfaces, preventing objects from being instantiated incompletely. */ -@SuppressWarningsPrefix({ - // Preferred checkername. - "calledmethods", - // Deprecated checkernames, supported for backward compatibility. - "builder", - "object.construction", - "objectconstruction" -}) @SupportedOptions({ CalledMethodsChecker.USE_VALUE_CHECKER, CalledMethodsChecker.COUNT_FRAMEWORK_BUILD_CALLS, diff --git a/checker/src/main/java/org/checkerframework/checker/rlccalledmethods/RLCCalledMethodsChecker.java b/checker/src/main/java/org/checkerframework/checker/rlccalledmethods/RLCCalledMethodsChecker.java index d0ea37cd483..dff1495431b 100644 --- a/checker/src/main/java/org/checkerframework/checker/rlccalledmethods/RLCCalledMethodsChecker.java +++ b/checker/src/main/java/org/checkerframework/checker/rlccalledmethods/RLCCalledMethodsChecker.java @@ -11,6 +11,7 @@ import org.checkerframework.common.basetype.BaseTypeVisitor; import org.checkerframework.framework.qual.StubFiles; import org.checkerframework.framework.source.SourceChecker; +import org.checkerframework.framework.source.SuppressWarningsPrefix; import org.checkerframework.javacutil.TypeSystemError; import org.checkerframework.javacutil.UserError; @@ -20,6 +21,7 @@ * Runs the MustCallChecker as a subchecker in order to share the CFG. */ @StubFiles("IOUtils.astub") +@SuppressWarningsPrefix({"calledmethods", "rlccalledmethods", "resourceleak"}) public class RLCCalledMethodsChecker extends CalledMethodsChecker { /** Creates a RLCCalledMethodsChecker. */ diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 02f88a04ae6..9db88ffe275 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -3,10 +3,16 @@ -## Version 4.0.1 (2026-05-01) +## Version 4.1.0 (2026-05-01) ### User-visible changes +Removed deprecated script `checker/bin-devel/build.sh`; use `./gradlew assemble` +instead. + +Removed deprecated names "builder", "object.construction", and +"objectconstruction" for the Called Methods Checker. + ### Implementation details ### Closed issues diff --git a/framework/src/main/java/org/checkerframework/framework/type/AnnotationClassLoader.java b/framework/src/main/java/org/checkerframework/framework/type/AnnotationClassLoader.java index a247c5c920a..747c7b11198 100644 --- a/framework/src/main/java/org/checkerframework/framework/type/AnnotationClassLoader.java +++ b/framework/src/main/java/org/checkerframework/framework/type/AnnotationClassLoader.java @@ -114,7 +114,7 @@ public class AnnotationClassLoader implements Closeable { private final URL resourceURL; /** The class loader used to load annotation classes. */ - @SuppressWarnings("builder:required.method.not.called") // this class is @MustCall({}) + @SuppressWarnings("rlccalledmethods:required.method.not.called") // this class is @MustCall({}) protected final @Owning URLClassLoader classLoader; /** diff --git a/javacutil/src/main/java/org/checkerframework/javacutil/SystemUtil.java b/javacutil/src/main/java/org/checkerframework/javacutil/SystemUtil.java index 4382f27f1d8..d921ef55a00 100644 --- a/javacutil/src/main/java/org/checkerframework/javacutil/SystemUtil.java +++ b/javacutil/src/main/java/org/checkerframework/javacutil/SystemUtil.java @@ -11,8 +11,6 @@ import java.nio.charset.StandardCharsets; import java.util.Collections; import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import javax.annotation.processing.ProcessingEnvironment; import org.checkerframework.checker.nullness.qual.Nullable; import org.checkerframework.common.value.qual.IntVal; @@ -151,46 +149,8 @@ public static int readCodePoint(InputStream is) { throw new IllegalArgumentException(); // Invalid first byte for UTF-8 character. } - /** The major version number of the Java runtime (JRE), such as 8, 11, or 17. */ - @SuppressWarnings("deprecation") // remove @SuppressWarnings when getJreVersion() isn't deprecated - public static final int jreVersion = getJreVersion(); - - // Keep in sync with BCELUtil.java (in the bcel-util project). - /** - * Returns the major version number from the "java.version" system property, such as 8, 11, or 17. - * - *

This is different from the version passed to the compiler via {@code --release}; use {@link - * #getReleaseValue(ProcessingEnvironment)} to get that version. - * - *

Two possible formats of the "java.version" system property are considered. Up to Java 8, - * from a version string like `1.8.whatever`, this method extracts 8. Since Java 9, from a version - * string like `11.0.1`, this method extracts 11. - * - *

Starting in Java 9, there is the int {@code Runtime.version().feature()}, but that does not - * exist on JDK 8. - * - * @return the major version of the Java runtime - */ - private static int getJreVersion() { - String version = System.getProperty("java.version"); - - // Up to Java 8, from a version string like "1.8.whatever", extract "8". - if (version.startsWith("1.")) { - return Integer.parseInt(version.substring(2, 3)); - } - - // Since Java 9, from a version string like "11.0.1" or "11-ea" or "11u25", extract "11". - // The format is described at https://openjdk.org/jeps/223 . - Pattern newVersionPattern = Pattern.compile("^(\\d+).*$"); - Matcher newVersionMatcher = newVersionPattern.matcher(version); - if (newVersionMatcher.matches()) { - String v = newVersionMatcher.group(1); - assert v != null : "@AssumeAssertion(nullness): inspection"; - return Integer.parseInt(v); - } - - throw new RuntimeException("Could not determine version from property java.version=" + version); - } + /** The major version number of the Java runtime (JRE), such as 17, 21, or 25. */ + public static final int jreVersion = Runtime.version().feature(); /** * Returns the release value passed to the compiler or null if release was not passed.