Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
4ac32c6
Add all annotations from PICO
Dec 28, 2024
2d4b59a
Annotate `Object`
Dec 28, 2024
8d05b23
Annotate `Serializable`
Dec 29, 2024
db869cc
Annotate `Date`
Dec 29, 2024
3466455
Annotate `FileInputStream` and `ObjectOutputStream`
Dec 29, 2024
50c2952
Annotate `Iterator`
Dec 29, 2024
1d6408f
Annotate `Throwable`
Dec 29, 2024
de05b72
Annotate `IndexOutOfBoundsException`
Dec 29, 2024
3936f73
Annotate `StringBuilder`
Dec 29, 2024
8156957
Annotate `CharSequence`
Dec 29, 2024
22347f4
Annotate `String`
Dec 29, 2024
9cd9d17
Annotate `RuntimeException`
Dec 29, 2024
1d8b0c0
Annotate `Cloneable`
Dec 29, 2024
8be60b7
Annotate `Comparable`
Dec 29, 2024
ca9f48d
Annotate `Collection`
Dec 29, 2024
31387f6
Annotate `AbstractCollection`
Dec 29, 2024
d7e5a00
More annotations for `Iterator`
Dec 29, 2024
5504162
Annotate `List`
Dec 29, 2024
e282eb2
Import PICO in `List`
Dec 29, 2024
c5a0af6
Annotate `Collections`
Dec 29, 2024
c5f61b9
Annotate `AbstractList`
Dec 29, 2024
2d57c20
Annotate `Map`
Dec 29, 2024
a153821
Annotate `AbstractMap`
Dec 29, 2024
89d2c16
Annotate `HashMap`
Dec 29, 2024
26047b9
Annotate `Set`
Dec 29, 2024
43324c0
Annotate `AbstractSet`
Dec 29, 2024
2bf56b1
Annotate `HashSet`
Dec 29, 2024
b1d7ea2
Annotate `ArrayList`
Dec 29, 2024
4aca645
Annotate `File`
Dec 29, 2024
30ee3e5
Annotate `StringBuffer`
Dec 29, 2024
a45538d
Annotate `AbstractStringBuilder`
Dec 29, 2024
111fe02
Annotate `Array`
Dec 29, 2024
5e51849
More annotations for `Arrays`
Dec 29, 2024
b9ac1fc
Annotate `Stack`
Dec 29, 2024
adfe794
Annotate `Vector`
Dec 29, 2024
7bb4912
Import Readonly in `Logger`
Dec 29, 2024
552b2a5
Annotate `HashTable`
Dec 29, 2024
0dccf15
Annotate `PrintStream`
Dec 29, 2024
50fdf29
Annotate `PrintWriter`
Dec 29, 2024
ce93b81
Annotate `Container`
Dec 29, 2024
3be97ae
Annotate `AnnotationMirror`
Dec 29, 2024
d8d42c9
Annotate `ExecutionException`
Dec 29, 2024
50bbc71
Export PICO in `module-info.java`
Dec 30, 2024
733b538
Fix typos and reorder qualifier
Dec 30, 2024
d452318
Fix import
Dec 30, 2024
02f104d
Fix import
Dec 30, 2024
52c8a4a
A few mutable annotations for setters
Dec 30, 2024
852ec54
A few mutable annotations for setters
Dec 30, 2024
85b5275
A few mutable annotations for setters in Map
Dec 30, 2024
fef7277
Entryset's receiver should be readonly
Dec 30, 2024
61f55da
Allow constructor to take any take arraylist
aosen-xiong Jan 8, 2025
a32a288
Add import
aosen-xiong Jan 8, 2025
c5777c3
Annotate getter as Readonly
aosen-xiong Jan 8, 2025
1360278
Annotate util method in Object
aosen-xiong Jan 11, 2025
e4fbd15
Annotate util method in Object
aosen-xiong Jan 11, 2025
dfa3348
A few more annotations
aosen-xiong Jan 14, 2025
7101885
More annotations
aosen-xiong Jan 14, 2025
ec1d6c3
Make copyof polymutable
aosen-xiong Jan 12, 2025
bbea90a
Make arraycopy polymutable
aosen-xiong Jan 12, 2025
af50f17
Annotation for `AtomicInteger`
aosen-xiong Jan 12, 2025
852dfff
Correct array annotations
aosen-xiong Jan 24, 2025
19a2c57
More annotations
aosen-xiong Jan 24, 2025
e771edd
More annotations
aosen-xiong Jan 24, 2025
14410e2
A large update
aosen-xiong Apr 15, 2025
df801bd
Merge remote-tracking branch 'origin/master' into pico-move
aosen-xiong Apr 15, 2025
0bb59f1
Remove sideeffectsonly annotations because of merge errors
aosen-xiong Apr 15, 2025
eea9cf1
Fix DefaultQualifier because of merge error
aosen-xiong Apr 15, 2025
cabab35
Undo error in treemap because of merge
aosen-xiong Apr 15, 2025
457007f
Commit PICO annotation
aosen-xiong Apr 15, 2025
de61bde
Commit PICO annotation
aosen-xiong Apr 15, 2025
6245543
Commit PICO annotation
aosen-xiong Apr 15, 2025
bf4e90d
Commit PICO annotation
aosen-xiong Apr 15, 2025
f4cf00f
All good!
aosen-xiong Apr 16, 2025
5b4485e
Fix a few errors and remove redundant mutable
aosen-xiong May 6, 2025
5587b8f
Continue suppress warnings on Date
aosen-xiong May 11, 2025
1f9600e
Add a few Initialization annotations
aosen-xiong May 11, 2025
13593db
Remove unused import
aosen-xiong May 11, 2025
1f2cd40
Merge branch 'master' into pico-move
aosen-xiong Oct 6, 2025
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ NashornProfile.txt
**/JTreport/**
**/JTwork/**
/src/utils/LogCompilation/target/

*.class
5 changes: 4 additions & 1 deletion src/java.base/share/classes/java/io/File.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,14 @@
import org.checkerframework.checker.lock.qual.GuardSatisfied;
import org.checkerframework.checker.lock.qual.ReleasesNoLocks;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.checker.pico.qual.ReceiverDependentMutable;
import org.checkerframework.checker.pico.qual.Readonly;
import org.checkerframework.checker.regex.qual.Regex;
import org.checkerframework.dataflow.qual.Pure;
import org.checkerframework.dataflow.qual.SideEffectFree;
import org.checkerframework.framework.qual.AnnotatedFor;
import org.checkerframework.framework.qual.CFComment;
import org.checkerframework.framework.qual.DefaultQualifierForUse;

import java.net.URI;
import java.net.URL;
Expand Down Expand Up @@ -162,7 +165,7 @@
"EnsuresNonNullIf(expression={\"list()\",\"list(FilenameFilter)\",\"listFiles()\",\"listFiles(FilenameFilter)\",\"listFiles(FileFilter)\"}, result=true)\""
})
@AnnotatedFor({"index", "initialization", "interning", "lock", "nullness"})
public class File
@ReceiverDependentMutable public class File
implements Serializable, Comparable<File>
{

Expand Down
6 changes: 4 additions & 2 deletions src/java.base/share/classes/java/io/FileInputStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
import org.checkerframework.checker.index.qual.LTLengthOf;
import org.checkerframework.checker.index.qual.NonNegative;
import org.checkerframework.checker.mustcall.qual.MustCallAlias;
import org.checkerframework.checker.pico.qual.ReceiverDependentMutable;
import org.checkerframework.checker.pico.qual.Readonly;
import org.checkerframework.framework.qual.AnnotatedFor;

import java.nio.channels.FileChannel;
Expand Down Expand Up @@ -70,7 +72,7 @@
* @since 1.0
*/
@AnnotatedFor({"index", "initialization", "mustcall", "nullness"})
public class FileInputStream extends InputStream
public @ReceiverDependentMutable class FileInputStream extends InputStream
{
private static final int DEFAULT_BUFFER_SIZE = 8192;

Expand Down Expand Up @@ -147,7 +149,7 @@ public FileInputStream(String name) throws FileNotFoundException {
* @see java.io.File#getPath()
* @see java.lang.SecurityManager#checkRead(java.lang.String)
*/
public FileInputStream(File file) throws FileNotFoundException {
public @ReceiverDependentMutable FileInputStream(@Readonly File file) throws FileNotFoundException {
String name = (file != null ? file.getPath() : null);
@SuppressWarnings("removal")
SecurityManager security = System.getSecurityManager();
Expand Down
5 changes: 3 additions & 2 deletions src/java.base/share/classes/java/io/IOException.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
package java.io;

import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.checker.pico.qual.Readonly;
import org.checkerframework.framework.qual.AnnotatedFor;

/**
Expand Down Expand Up @@ -80,7 +81,7 @@ public IOException(@Nullable String message) {
*
* @since 1.6
*/
public IOException(@Nullable String message, @Nullable Throwable cause) {
public IOException(@Nullable String message, @Nullable @Readonly Throwable cause) {
super(message, cause);
}

Expand All @@ -98,7 +99,7 @@ public IOException(@Nullable String message, @Nullable Throwable cause) {
*
* @since 1.6
*/
public IOException(@Nullable Throwable cause) {
public IOException(@Nullable @Readonly Throwable cause) {
super(cause);
}
}
3 changes: 2 additions & 1 deletion src/java.base/share/classes/java/io/ObjectOutputStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.checkerframework.checker.index.qual.NonNegative;
import org.checkerframework.checker.mustcall.qual.MustCallAlias;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.checker.pico.qual.Readonly;
import org.checkerframework.checker.signedness.qual.PolySigned;
import org.checkerframework.framework.qual.AnnotatedFor;

Expand Down Expand Up @@ -354,7 +355,7 @@ public void useProtocolVersion(int version) throws IOException {
* @throws IOException Any exception thrown by the underlying
* OutputStream.
*/
public final void writeObject(@Nullable Object obj) throws IOException {
public final void writeObject(@Readonly @Nullable Object obj) throws IOException {
if (enableOverride) {
writeObjectOverride(obj);
return;
Expand Down
14 changes: 8 additions & 6 deletions src/java.base/share/classes/java/io/PrintStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
import org.checkerframework.checker.mustcall.qual.MustCallAlias;
import org.checkerframework.checker.mustcall.qual.NotOwning;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.checker.pico.qual.Readonly;
import org.checkerframework.checker.pico.qual.ReceiverDependentMutable;
import org.checkerframework.checker.signedness.qual.PolySigned;
import org.checkerframework.framework.qual.AnnotatedFor;
import org.checkerframework.framework.qual.CFComment;
Expand Down Expand Up @@ -75,7 +77,7 @@

@CFComment({"lock: TODO: Should parameters be @GuardSatisfied, or is the default of @GuardedBy({}) appropriate? (@GuardedBy({}) is more conservative.)"})
@AnnotatedFor({"formatter", "i18n", "index", "initialization", "lock", "mustcall", "nullness", "signedness"})
public class PrintStream extends FilterOutputStream
public @ReceiverDependentMutable class PrintStream extends FilterOutputStream
implements Appendable, Closeable
{

Expand Down Expand Up @@ -888,7 +890,7 @@ public void print(@GuardSatisfied PrintStream this, @Nullable String s) {
* @param obj The {@code Object} to be printed
* @see java.lang.Object#toString()
*/
public void print(@GuardSatisfied PrintStream this, @Nullable Object obj) {
public void print(@GuardSatisfied PrintStream this, @Nullable @Readonly Object obj) {
write(String.valueOf(obj));
}

Expand Down Expand Up @@ -1058,7 +1060,7 @@ public void println(@GuardSatisfied PrintStream this, @Nullable @Localized Strin
*
* @param x The {@code Object} to be printed.
*/
public void println(@GuardSatisfied PrintStream this, @Nullable Object x) {
public void println(@GuardSatisfied PrintStream this, @Nullable @Readonly Object x) {
String s = String.valueOf(x);
if (getClass() == PrintStream.class) {
// need to apply String.valueOf again since first invocation
Expand Down Expand Up @@ -1118,7 +1120,7 @@ public void println(@GuardSatisfied PrintStream this, @Nullable Object x) {
*/
@CFComment({"lock/nullness: The vararg arrays can actually be null, but let's not annotate them because passing null is bad style; see whether this annotation is useful."})
@FormatMethod
public @NotOwning PrintStream printf(@GuardSatisfied PrintStream this, String format, @Nullable Object ... args) {
public @NotOwning PrintStream printf(@GuardSatisfied PrintStream this, String format, @Nullable @Readonly Object ... args) {
return format(format, args);
}

Expand Down Expand Up @@ -1171,7 +1173,7 @@ public void println(@GuardSatisfied PrintStream this, @Nullable Object x) {
* @since 1.5
*/
@FormatMethod
public @NotOwning PrintStream printf(@GuardSatisfied PrintStream this, @Nullable Locale l, String format, @Nullable Object ... args) {
public @NotOwning PrintStream printf(@GuardSatisfied PrintStream this, @Nullable Locale l, String format, @Nullable @Readonly Object ... args) {
return format(l, format, args);
}

Expand Down Expand Up @@ -1277,7 +1279,7 @@ public void println(@GuardSatisfied PrintStream this, @Nullable Object x) {
* @since 1.5
*/
@FormatMethod
public @NotOwning PrintStream format(@GuardSatisfied PrintStream this, @Nullable Locale l, String format, @Nullable Object ... args) {
public @NotOwning PrintStream format(@GuardSatisfied PrintStream this, @Nullable Locale l, String format, @Nullable @Readonly Object ... args) {
try {
synchronized (this) {
ensureOpen();
Expand Down
17 changes: 10 additions & 7 deletions src/java.base/share/classes/java/io/PrintWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
import org.checkerframework.checker.lock.qual.GuardSatisfied;
import org.checkerframework.checker.mustcall.qual.MustCallAlias;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.checker.pico.qual.Readonly;
import org.checkerframework.checker.pico.qual.ReceiverDependentMutable;

import org.checkerframework.framework.qual.AnnotatedFor;

import java.util.Objects;
Expand Down Expand Up @@ -68,7 +71,7 @@
*/

@AnnotatedFor({"formatter", "index", "initialization", "lock", "mustcall", "nullness"})
public class PrintWriter extends Writer {
public @ReceiverDependentMutable class PrintWriter extends Writer {

/**
* The underlying character-output stream of this
Expand Down Expand Up @@ -705,7 +708,7 @@ public void print(@GuardSatisfied PrintWriter this, @Nullable String s) {
* @param obj The {@code Object} to be printed
* @see java.lang.Object#toString()
*/
public void print(@GuardSatisfied PrintWriter this, @Nullable Object obj) {
public void print(@GuardSatisfied PrintWriter this, @Nullable @Readonly Object obj) {
write(String.valueOf(obj));
}

Expand Down Expand Up @@ -841,7 +844,7 @@ public void println(@GuardSatisfied PrintWriter this, @Nullable String x) {
*
* @param x The {@code Object} to be printed.
*/
public void println(@GuardSatisfied PrintWriter this, @Nullable Object x) {
public void println(@GuardSatisfied PrintWriter this, @Nullable @Readonly Object x) {
String s = String.valueOf(x);
synchronized (lock) {
print(s);
Expand Down Expand Up @@ -894,7 +897,7 @@ public void println(@GuardSatisfied PrintWriter this, @Nullable Object x) {
* @since 1.5
*/
@FormatMethod
public @MustCallAlias PrintWriter printf(@GuardSatisfied @MustCallAlias PrintWriter this, String format, @Nullable Object ... args) {
public @MustCallAlias PrintWriter printf(@GuardSatisfied @MustCallAlias PrintWriter this, String format, @Nullable @Readonly Object ... args) {
return format(format, args);
}

Expand Down Expand Up @@ -948,7 +951,7 @@ public void println(@GuardSatisfied PrintWriter this, @Nullable Object x) {
* @since 1.5
*/
@FormatMethod
public @MustCallAlias PrintWriter printf(@GuardSatisfied @MustCallAlias PrintWriter this, @Nullable Locale l, String format, @Nullable Object ... args) {
public @MustCallAlias PrintWriter printf(@GuardSatisfied @MustCallAlias PrintWriter this, @Nullable Locale l, String format, @Nullable @Readonly Object ... args) {
return format(l, format, args);
}

Expand Down Expand Up @@ -993,7 +996,7 @@ public void println(@GuardSatisfied PrintWriter this, @Nullable Object x) {
* @since 1.5
*/
@FormatMethod
public @MustCallAlias PrintWriter format(@GuardSatisfied @MustCallAlias PrintWriter this, String format, @Nullable Object ... args) {
public @MustCallAlias PrintWriter format(@GuardSatisfied @MustCallAlias PrintWriter this, String format, @Nullable @Readonly Object ... args) {
try {
synchronized (lock) {
ensureOpen();
Expand Down Expand Up @@ -1054,7 +1057,7 @@ public void println(@GuardSatisfied PrintWriter this, @Nullable Object x) {
* @since 1.5
*/
@FormatMethod
public @MustCallAlias PrintWriter format(@GuardSatisfied @MustCallAlias PrintWriter this, @Nullable Locale l, String format, @Nullable Object ... args) {
public @MustCallAlias PrintWriter format(@GuardSatisfied @MustCallAlias PrintWriter this, @Nullable Locale l, String format, @Nullable @Readonly Object ... args) {
try {
synchronized (lock) {
ensureOpen();
Expand Down
3 changes: 2 additions & 1 deletion src/java.base/share/classes/java/io/Serializable.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
*/

package java.io;
import org.checkerframework.checker.pico.qual.ReceiverDependentMutable;

/**
* Serializability of a class is enabled by the class implementing the
Expand Down Expand Up @@ -190,5 +191,5 @@
* <cite>Java Object Serialization Specification</cite></a>
* @since 1.1
*/
public interface Serializable {
public @ReceiverDependentMutable interface Serializable {
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.checkerframework.checker.interning.qual.UsesObjectEquals;
import org.checkerframework.checker.lock.qual.GuardSatisfied;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.checker.pico.qual.Mutable;
import org.checkerframework.dataflow.qual.Pure;
import org.checkerframework.dataflow.qual.SideEffectFree;
import org.checkerframework.framework.qual.AnnotatedFor;
Expand Down
3 changes: 2 additions & 1 deletion src/java.base/share/classes/java/lang/AssertionError.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
package java.lang;

import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.checker.pico.qual.Readonly;
import org.checkerframework.dataflow.qual.SideEffectFree;
import org.checkerframework.framework.qual.AnnotatedFor;

Expand Down Expand Up @@ -79,7 +80,7 @@ private AssertionError(@Nullable String detailMessage) {
* @see Throwable#getCause()
*/
@SideEffectFree
public AssertionError(@Nullable Object detailMessage) {
public AssertionError(@Nullable @Readonly Object detailMessage) {
this(String.valueOf(detailMessage));
if (detailMessage instanceof Throwable)
initCause((Throwable) detailMessage);
Expand Down
5 changes: 4 additions & 1 deletion src/java.base/share/classes/java/lang/CharSequence.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@
import org.checkerframework.checker.lock.qual.GuardSatisfied;
import org.checkerframework.checker.nonempty.qual.EnsuresNonEmptyIf;
import org.checkerframework.checker.nonempty.qual.NonEmpty;
import org.checkerframework.checker.pico.qual.ReceiverDependentMutable;
import org.checkerframework.checker.pico.qual.Readonly;
import org.checkerframework.dataflow.qual.Pure;
import org.checkerframework.dataflow.qual.SideEffectFree;
import org.checkerframework.framework.qual.AnnotatedFor;
import org.checkerframework.framework.qual.DefaultQualifierForUse;

import java.util.NoSuchElementException;
import java.util.Objects;
Expand Down Expand Up @@ -68,7 +71,7 @@
*/

@AnnotatedFor({"lock", "nullness", "index"})
public interface CharSequence {
@ReceiverDependentMutable public interface CharSequence {

/**
* Returns the length of this character sequence. The length is the number
Expand Down
5 changes: 3 additions & 2 deletions src/java.base/share/classes/java/lang/Class.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.checker.nullness.qual.PolyNull;
import org.checkerframework.checker.nullness.qual.UnknownKeyFor;
import org.checkerframework.checker.pico.qual.Readonly;
import org.checkerframework.checker.signature.qual.CanonicalName;
import org.checkerframework.checker.signature.qual.ClassGetName;
import org.checkerframework.checker.signature.qual.ClassGetSimpleName;
Expand Down Expand Up @@ -223,7 +224,7 @@
"meaning, but are unrelated by the Java type hierarchy.",
"@Covariant makes Class<@NonNull String> a subtype of Class<@Nullable String>."})
@AnnotatedFor({"index", "interning", "lock", "nullness", "signature"})
@Covariant({0})
@Covariant(0)
public final @Interned class Class<@UnknownKeyFor T> implements java.io.Serializable,
GenericDeclaration,
Type,
Expand Down Expand Up @@ -719,7 +720,7 @@ public Void run() {
@Pure
@EnsuresNonNullIf(expression={"#1"}, result=true)
@IntrinsicCandidate
public native boolean isInstance(@GuardSatisfied Class<T> this, @Nullable Object obj);
public native boolean isInstance(@GuardSatisfied Class<T> this, @Nullable @Readonly Object obj);


/**
Expand Down
3 changes: 2 additions & 1 deletion src/java.base/share/classes/java/lang/Cloneable.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

package java.lang;

import org.checkerframework.checker.pico.qual.ReceiverDependentMutable;
import org.checkerframework.framework.qual.AnnotatedFor;

/**
Expand Down Expand Up @@ -52,5 +53,5 @@
* @since 1.0
*/
@AnnotatedFor({"nullness"})
public interface Cloneable {
public @ReceiverDependentMutable interface Cloneable {
}
6 changes: 4 additions & 2 deletions src/java.base/share/classes/java/lang/Comparable.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

import org.checkerframework.checker.lock.qual.GuardSatisfied;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.pico.qual.ReceiverDependentMutable;
import org.checkerframework.checker.pico.qual.Readonly;
import org.checkerframework.dataflow.qual.Pure;
import org.checkerframework.framework.qual.AnnotatedFor;
import org.checkerframework.framework.qual.CFComment;
Expand Down Expand Up @@ -110,7 +112,7 @@
* @since 1.2
*/
@AnnotatedFor({"lock", "nullness", "index"})
public interface Comparable<T extends @NonNull Object> {
@ReceiverDependentMutable public interface Comparable<T extends @NonNull @Readonly Object> {
/**
* Compares this object with the specified object for order. Returns a
* negative integer, zero, or a positive integer as this object is less
Expand Down Expand Up @@ -148,5 +150,5 @@ public interface Comparable<T extends @NonNull Object> {
*/
@CFComment("nullness: arguments may NOT be null")
@Pure
public int compareTo(@GuardSatisfied Comparable<T> this, @NonNull T o);
public int compareTo(@Readonly @GuardSatisfied Comparable<T> this, @NonNull T o);
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
package java.lang;

import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.checker.pico.qual.ReceiverDependentMutable;
import org.checkerframework.dataflow.qual.SideEffectFree;
import org.checkerframework.framework.qual.AnnotatedFor;

Expand All @@ -39,7 +40,7 @@
* @since 1.0
*/
@AnnotatedFor({"nullness"})
public class IndexOutOfBoundsException extends RuntimeException {
public @ReceiverDependentMutable class IndexOutOfBoundsException extends RuntimeException {
@java.io.Serial
private static final long serialVersionUID = 234122996006267687L;

Expand Down
Loading