Skip to content
Merged
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
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
run: make jdk

build_jdk21u:
if: endsWith(github.repository, '/jdk')
needs:
- check_generated_ci
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci.yml.m4
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ jobs:
run: make jdk

build_jdk21u:
if: endsWith(github.repository, '/jdk')
needs:
- check_generated_ci
runs-on: ubuntu-latest
Expand Down
4 changes: 3 additions & 1 deletion src/java.base/share/classes/java/io/BufferedReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import org.checkerframework.dataflow.qual.Pure;
// import org.checkerframework.dataflow.qual.SideEffectsOnly;
import org.checkerframework.framework.qual.AnnotatedFor;
import org.checkerframework.framework.qual.DoesNotUnrefineReceiver;

import java.util.Iterator;
import java.util.NoSuchElementException;
Expand Down Expand Up @@ -510,8 +511,8 @@ private long implSkip(long n) throws IOException {
*
* @throws IOException If an I/O error occurs
*/
@EnsuresNonNullIf(expression={"readLine()"}, result=true)
@Pure
@EnsuresNonNullIf(expression={"readLine()"}, result=true)
public boolean ready(@GuardSatisfied BufferedReader this) throws IOException {
Object lock = this.lock;
if (lock instanceof InternalLock locker) {
Expand Down Expand Up @@ -709,6 +710,7 @@ public boolean hasNext() {

@Override
// @SideEffectsOnly("this")
@DoesNotUnrefineReceiver("modifiability")
public String next(/*@NonEmpty Iterator<String> this*/) {
if (nextLine != null || hasNext()) {
String line = nextLine;
Expand Down
3 changes: 3 additions & 0 deletions src/java.base/share/classes/java/lang/CharSequence.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.checkerframework.dataflow.qual.SideEffectFree;
// import org.checkerframework.dataflow.qual.SideEffectsOnly;
import org.checkerframework.framework.qual.AnnotatedFor;
import org.checkerframework.framework.qual.DoesNotUnrefineReceiver;

import java.util.NoSuchElementException;
import java.util.Objects;
Expand Down Expand Up @@ -175,6 +176,7 @@ public boolean hasNext() {
}

// @SideEffectsOnly("this")
@DoesNotUnrefineReceiver("modifiability")
public int nextInt(@NonEmpty CharIterator this) {
if (hasNext()) {
return charAt(cur++);
Expand Down Expand Up @@ -252,6 +254,7 @@ public boolean hasNext() {
}

// @SideEffectsOnly("this")
@DoesNotUnrefineReceiver("modifiability")
public int nextInt(@NonEmpty CodePointIterator this) {
final int length = length();

Expand Down
2 changes: 1 addition & 1 deletion src/java.base/share/classes/java/lang/Class.java
Original file line number Diff line number Diff line change
Expand Up @@ -840,8 +840,8 @@ public Void run() {
* {@code false} otherwise.
* @since 1.1
*/
@EnsuresNonNullIf(expression={"getComponentType()"}, result=true)
@Pure
@EnsuresNonNullIf(expression={"getComponentType()"}, result=true)
@IntrinsicCandidate
public native boolean isArray(@GuardSatisfied Class<T> this);

Expand Down
4 changes: 2 additions & 2 deletions src/java.base/share/classes/java/lang/String.java
Original file line number Diff line number Diff line change
Expand Up @@ -1945,8 +1945,8 @@ public void getBytes(@IndexOrHigh({"this"}) int srcBegin, @IndexOrHigh({"this"})
* @see #compareTo(String)
* @see #equalsIgnoreCase(String)
*/
@EnsuresNonNullIf(expression={"#1"}, result=true)
@Pure
@EnsuresNonNullIf(expression={"#1"}, result=true)
@StaticallyExecutable
public boolean equals(@GuardSatisfied @Nullable Object anObject) {
if (this == anObject) {
Expand Down Expand Up @@ -2084,8 +2084,8 @@ public boolean contentEquals(@GuardSatisfied CharSequence cs) {
* @see #equals(Object)
* @see #codePoints()
*/
@EnsuresNonNullIf(expression={"#1"}, result=true)
@Pure
@EnsuresNonNullIf(expression={"#1"}, result=true)
@StaticallyExecutable
public boolean equalsIgnoreCase(@Nullable String anotherString) {
return (this == anotherString) ? true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.checkerframework.checker.nonempty.qual.NonEmpty;
import org.checkerframework.dataflow.qual.Pure;
// import org.checkerframework.dataflow.qual.SideEffectsOnly;
import org.checkerframework.framework.qual.DoesNotUnrefineReceiver;

import java.util.*;
import jdk.internal.vm.annotation.Stable;
Expand Down Expand Up @@ -101,6 +102,7 @@ public boolean hasNext() {

@Override
// @SideEffectsOnly("this")
@DoesNotUnrefineReceiver("modifiability")
public Object next(@NonEmpty AsIterator this) {
int i = bumpIndex();
if (resolving)
Expand Down
2 changes: 2 additions & 0 deletions src/java.base/share/classes/java/net/URL.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.checkerframework.dataflow.qual.SideEffectFree;
// import org.checkerframework.dataflow.qual.SideEffectsOnly;
import org.checkerframework.framework.qual.AnnotatedFor;
import org.checkerframework.framework.qual.DoesNotUnrefineReceiver;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -1513,6 +1514,7 @@ public boolean hasNext() {
}

// @SideEffectsOnly("this")
@DoesNotUnrefineReceiver("modifiability")
public URLStreamHandlerProvider next(/*@NonEmpty Iterator<URLStreamHandlerProvider> this*/) {
if (!getNext())
throw new NoSuchElementException();
Expand Down
2 changes: 2 additions & 0 deletions src/java.base/share/classes/java/nio/charset/Charset.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.checkerframework.checker.nonempty.qual.NonEmpty;
import org.checkerframework.dataflow.qual.Pure;
// import org.checkerframework.dataflow.qual.SideEffectsOnly;
import org.checkerframework.framework.qual.DoesNotUnrefineReceiver;

import jdk.internal.misc.ThreadTracker;
import jdk.internal.misc.VM;
Expand Down Expand Up @@ -371,6 +372,7 @@ public boolean hasNext() {
}

// @SideEffectsOnly("this")
@DoesNotUnrefineReceiver("modifiability")
public CharsetProvider next(/*@NonEmpty Iterator<CharsetProvider> this*/) {
if (!getNext())
throw new NoSuchElementException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.checkerframework.checker.nonempty.qual.NonEmpty;
import org.checkerframework.dataflow.qual.Pure;
// import org.checkerframework.dataflow.qual.SideEffectsOnly;
import org.checkerframework.framework.qual.DoesNotUnrefineReceiver;

import java.io.Closeable;
import java.io.IOException;
Expand Down Expand Up @@ -113,6 +114,7 @@ public boolean hasNext() {

@Override
// @SideEffectsOnly("this")
@DoesNotUnrefineReceiver("modifiability")
public Event next(@NonEmpty FileTreeIterator this) {
if (!walker.isOpen())
throw new IllegalStateException();
Expand Down
4 changes: 3 additions & 1 deletion src/java.base/share/classes/java/nio/file/Files.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@
import org.checkerframework.checker.mustcall.qual.MustCall;
import org.checkerframework.checker.nonempty.qual.EnsuresNonEmptyIf;
import org.checkerframework.checker.nonempty.qual.NonEmpty;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.checker.signedness.qual.PolySigned;
import org.checkerframework.dataflow.qual.Pure;
import org.checkerframework.dataflow.qual.SideEffectFree;
// import org.checkerframework.dataflow.qual.SideEffectsOnly;
import org.checkerframework.framework.qual.AnnotatedFor;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.framework.qual.DoesNotUnrefineReceiver;

import java.io.BufferedReader;
import java.io.BufferedWriter;
Expand Down Expand Up @@ -3866,6 +3867,7 @@ public boolean hasNext() {
}
}
// @SideEffectsOnly("this")
@DoesNotUnrefineReceiver("modifiability")
@Override
public Path next(/*@NonEmpty Iterator<Path> this*/) {
try {
Expand Down
2 changes: 2 additions & 0 deletions src/java.base/share/classes/java/nio/file/Path.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.checkerframework.dataflow.qual.SideEffectFree;
// import org.checkerframework.dataflow.qual.SideEffectsOnly;
import org.checkerframework.framework.qual.AnnotatedFor;
import org.checkerframework.framework.qual.DoesNotUnrefineReceiver;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -963,6 +964,7 @@ public boolean hasNext() {

@Override
// @SideEffectsOnly("this")
@DoesNotUnrefineReceiver("modifiability")
public Path next(/*@NonEmpty Iterator<Path> this*/) {
if (i < getNameCount()) {
Path result = getName(i);
Expand Down
6 changes: 6 additions & 0 deletions src/java.base/share/classes/java/security/Provider.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.checker.nullness.qual.PolyNull;
import org.checkerframework.checker.signedness.qual.UnknownSignedness;
import org.checkerframework.framework.qual.DoesNotUnrefineReceiver;

import jdk.internal.event.SecurityProviderServiceEvent;

Expand Down Expand Up @@ -635,6 +636,7 @@ public synchronized Object replace(Object key, Object value) {
* @since 1.8
*/
@Override
@DoesNotUnrefineReceiver("modifiability")
public synchronized void replaceAll(BiFunction<? super Object,
? super Object, ? extends Object> function) {
check("putProviderProperty." + name);
Expand Down Expand Up @@ -663,6 +665,7 @@ public synchronized void replaceAll(BiFunction<? super Object,
* @since 1.8
*/
@Override
@DoesNotUnrefineReceiver("modifiability")
public synchronized @PolyNull Object compute(Object key, BiFunction<? super Object,
? super Object, ? extends @PolyNull Object> remappingFunction) {
check("putProviderProperty." + name);
Expand Down Expand Up @@ -693,6 +696,7 @@ public synchronized void replaceAll(BiFunction<? super Object,
* @since 1.8
*/
@Override
@DoesNotUnrefineReceiver("modifiability")
public synchronized @PolyNull Object computeIfAbsent(Object key,
Function<? super Object, ? extends @PolyNull Object> mappingFunction) {
check("putProviderProperty." + name);
Expand Down Expand Up @@ -722,6 +726,7 @@ public synchronized void replaceAll(BiFunction<? super Object,
* @since 1.8
*/
@Override
@DoesNotUnrefineReceiver("modifiability")
public synchronized @PolyNull Object computeIfPresent(Object key,
BiFunction<? super Object, ? super Object, ? extends @PolyNull Object>
remappingFunction) {
Expand Down Expand Up @@ -755,6 +760,7 @@ public synchronized void replaceAll(BiFunction<? super Object,
* @since 1.8
*/
@Override
@DoesNotUnrefineReceiver("modifiability")
public synchronized @PolyNull Object merge(Object key, Object value,
BiFunction<? super Object, ? super Object, ? extends @PolyNull Object>
remappingFunction) {
Expand Down
13 changes: 13 additions & 0 deletions src/java.base/share/classes/java/util/AbstractCollection.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import org.checkerframework.dataflow.qual.SideEffectFree;
import org.checkerframework.framework.qual.AnnotatedFor;
import org.checkerframework.framework.qual.CFComment;
import org.checkerframework.framework.qual.DoesNotUnrefineReceiver;

import jdk.internal.util.ArraysSupport;

Expand Down Expand Up @@ -275,6 +276,8 @@ private static <T> T[] finishToArray(T[] r, Iterator<?> it) {
* @throws IllegalArgumentException {@inheritDoc}
* @throws IllegalStateException {@inheritDoc}
*/
// @SideEffectsOnly("this")
@DoesNotUnrefineReceiver("modifiability")
public boolean add(@GuardSatisfied AbstractCollection<E> this, E e) {
throw new UnsupportedOperationException();
}
Expand All @@ -296,6 +299,8 @@ public boolean add(@GuardSatisfied AbstractCollection<E> this, E e) {
* @throws ClassCastException {@inheritDoc}
* @throws NullPointerException {@inheritDoc}
*/
// @SideEffectsOnly("this")
@DoesNotUnrefineReceiver("modifiability")
public boolean remove(@GuardSatisfied @CanShrink AbstractCollection<E> this, @GuardSatisfied @UnknownSignedness Object o) {
Iterator<E> it = iterator();
if (o==null) {
Expand Down Expand Up @@ -359,6 +364,8 @@ public boolean containsAll(@GuardSatisfied AbstractCollection<E> this, @GuardSat
*
* @see #add(Object)
*/
// @SideEffectsOnly("this")
@DoesNotUnrefineReceiver("modifiability")
public boolean addAll(@GuardSatisfied AbstractCollection<E> this, Collection<? extends E> c) {
boolean modified = false;
for (E e : c)
Expand Down Expand Up @@ -389,6 +396,8 @@ public boolean addAll(@GuardSatisfied AbstractCollection<E> this, Collection<? e
* @see #remove(Object)
* @see #contains(Object)
*/
// @SideEffectsOnly("this")
@DoesNotUnrefineReceiver("modifiability")
public boolean removeAll(@GuardSatisfied @CanShrink AbstractCollection<E> this, Collection<? extends @UnknownSignedness Object> c) {
Objects.requireNonNull(c);
boolean modified = false;
Expand Down Expand Up @@ -424,6 +433,8 @@ public boolean removeAll(@GuardSatisfied @CanShrink AbstractCollection<E> this,
* @see #remove(Object)
* @see #contains(Object)
*/
// @SideEffectsOnly("this")
@DoesNotUnrefineReceiver("modifiability")
public boolean retainAll(@GuardSatisfied @CanShrink AbstractCollection<E> this, Collection<? extends @UnknownSignedness Object> c) {
Objects.requireNonNull(c);
boolean modified = false;
Expand Down Expand Up @@ -453,6 +464,8 @@ public boolean retainAll(@GuardSatisfied @CanShrink AbstractCollection<E> this,
*
* @throws UnsupportedOperationException {@inheritDoc}
*/
// @SideEffectsOnly("this")
@DoesNotUnrefineReceiver("modifiability")
public void clear(@GuardSatisfied @CanShrink AbstractCollection<E> this) {
Iterator<E> it = iterator();
while (it.hasNext()) {
Expand Down
Loading