Skip to content

Commit

Permalink
Update for typetools/checker-framework 3.35.0 release (typetools#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
wmdietl authored Oct 6, 2023
2 parents cbf4281 + fd93cfc commit 11a1c44
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/java.base/share/classes/java/io/DataOutput.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.checkerframework.checker.index.qual.IndexOrHigh;
import org.checkerframework.checker.index.qual.LTLengthOf;
import org.checkerframework.checker.index.qual.NonNegative;
import org.checkerframework.checker.signedness.qual.PolySigned;
import org.checkerframework.framework.qual.AnnotatedFor;

/**
Expand Down Expand Up @@ -99,7 +100,7 @@ public interface DataOutput {
* @param len the number of bytes to write.
* @throws IOException if an I/O error occurs.
*/
void write(byte b[], @IndexOrHigh({"#1"}) int off, @LTLengthOf(value={"#1"}, offset={"#2 - 1"}) @NonNegative int len) throws IOException;
void write(@PolySigned byte b[], @IndexOrHigh({"#1"}) int off, @LTLengthOf(value={"#1"}, offset={"#2 - 1"}) @NonNegative int len) throws IOException;

/**
* Writes a {@code boolean} value to this output stream.
Expand Down
6 changes: 3 additions & 3 deletions src/java.base/share/classes/java/io/OutputStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@

package java.io;

import org.checkerframework.checker.mustcall.qual.MustCall;
import org.checkerframework.checker.index.qual.IndexOrHigh;
import org.checkerframework.checker.index.qual.LTLengthOf;
import org.checkerframework.checker.index.qual.NonNegative;
import org.checkerframework.checker.interning.qual.UsesObjectEquals;
import org.checkerframework.checker.mustcall.qual.MustCall;
import org.checkerframework.checker.signedness.qual.PolySigned;
import org.checkerframework.framework.qual.AnnotatedFor;

Expand Down Expand Up @@ -88,12 +88,12 @@ private void ensureOpen() throws IOException {
}

@Override
public void write(int b) throws IOException {
public void write(@PolySigned int b) throws IOException {
ensureOpen();
}

@Override
public void write(byte b[], int off, int len) throws IOException {
public void write(@PolySigned byte b[], int off, int len) throws IOException {
Objects.checkFromIndexSize(off, len, b.length);
ensureOpen();
}
Expand Down
5 changes: 3 additions & 2 deletions src/java.base/share/classes/java/lang/Object.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.checkerframework.checker.mustcall.qual.MustCall;
import org.checkerframework.checker.nullness.qual.EnsuresNonNullIf;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.checker.signedness.qual.UnknownSignedness;
import org.checkerframework.checker.tainting.qual.Untainted;
import org.checkerframework.common.aliasing.qual.Unique;
import org.checkerframework.common.reflection.qual.GetClass;
Expand Down Expand Up @@ -86,7 +87,7 @@ public class Object {
@SafeEffect
@Pure
@IntrinsicCandidate
public final native Class<? extends @MustCall() Object> getClass(@PolyUI @GuardSatisfied @UnknownInitialization Object this);
public final native Class<? extends @MustCall() Object> getClass(@PolyUI @GuardSatisfied @UnknownInitialization @UnknownSignedness Object this);

/**
* Returns a hash code value for the object. This method is
Expand Down Expand Up @@ -123,7 +124,7 @@ public class Object {
*/
@Pure
@IntrinsicCandidate
public native int hashCode(@GuardSatisfied Object this);
public native int hashCode(@GuardSatisfied @UnknownSignedness Object this);

/**
* Indicates whether some other object is "equal to" this one.
Expand Down
1 change: 1 addition & 0 deletions src/java.base/share/classes/java/util/Collections.java
Original file line number Diff line number Diff line change
Expand Up @@ -5825,6 +5825,7 @@ public static <T> boolean addAll(@GuardSatisfied Collection<? super T> c, T... e
* @throws IllegalArgumentException if {@code map} is not empty
* @since 1.6
*/
@SideEffectFree
public static <E> Set<E> newSetFromMap(Map<E, Boolean> map) {
return new SetFromMap<>(map);
}
Expand Down

0 comments on commit 11a1c44

Please sign in to comment.