Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -398,15 +398,14 @@ 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.
*
* <p>Java provides no public method with this functionality, unfortunately.
*
* @param l a long integer
* @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);
Expand Down
15 changes: 0 additions & 15 deletions checker/bin-devel/build.sh

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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. */
Expand Down
8 changes: 7 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@
<!-- markdownlint-disable no-duplicate-heading -->
<!-- pyml disable no-duplicate-heading -->

## 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
*
* <p>This is different from the version passed to the compiler via {@code --release}; use {@link
* #getReleaseValue(ProcessingEnvironment)} to get that version.
*
* <p>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.
*
* <p>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.
Expand Down
Loading