diff --git a/src/java.base/share/classes/java/util/ArrayDeque.java b/src/java.base/share/classes/java/util/ArrayDeque.java --- a/src/java.base/share/classes/java/util/ArrayDeque.java +++ b/src/java.base/share/classes/java/util/ArrayDeque.java @@ -37,7 +37,6 @@ import java.io.Serializable; import java.util.function.Consumer; import java.util.function.Predicate; - import jdk.internal.access.SharedSecrets; /** diff --git a/src/java.base/share/classes/java/util/ArrayList.java b/src/java.base/share/classes/java/util/ArrayList.java --- a/src/java.base/share/classes/java/util/ArrayList.java +++ b/src/java.base/share/classes/java/util/ArrayList.java @@ -1729,7 +1729,6 @@ @Override public void replaceAll(UnaryOperator operator) { replaceAllRange(operator, 0, size); - modCount++; } private void replaceAllRange(UnaryOperator operator, int i, int end) { diff --git a/src/java.base/share/classes/java/util/Vector.java b/src/java.base/share/classes/java/util/Vector.java --- a/src/java.base/share/classes/java/util/Vector.java +++ b/src/java.base/share/classes/java/util/Vector.java @@ -1402,7 +1402,6 @@ es[i] = operator.apply(elementAt(es, i)); if (modCount != expectedModCount) throw new ConcurrentModificationException(); - modCount++; } @SuppressWarnings("unchecked") diff --git a/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java b/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java --- a/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java +++ b/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java @@ -2542,6 +2542,8 @@ setTabAt(tab, i, fwd); advance = true; } + else if (f instanceof ReservationNode) + throw new IllegalStateException("Recursive update"); } } } diff --git a/src/java.base/share/classes/java/util/concurrent/Exchanger.java b/src/java.base/share/classes/java/util/concurrent/Exchanger.java --- a/src/java.base/share/classes/java/util/concurrent/Exchanger.java +++ b/src/java.base/share/classes/java/util/concurrent/Exchanger.java @@ -564,8 +564,8 @@ Object item = (x == null) ? NULL_ITEM : x; // translate null args if (((a = arena) != null || (v = slotExchange(item, false, 0L)) == null) && - ((Thread.interrupted() || // disambiguates null return - (v = arenaExchange(item, false, 0L)) == null))) + (Thread.interrupted() || // disambiguates null return + (v = arenaExchange(item, false, 0L)) == null)) throw new InterruptedException(); return (v == NULL_ITEM) ? null : (V)v; } @@ -620,8 +620,8 @@ long ns = unit.toNanos(timeout); if ((arena != null || (v = slotExchange(item, true, ns)) == null) && - ((Thread.interrupted() || - (v = arenaExchange(item, true, ns)) == null))) + (Thread.interrupted() || + (v = arenaExchange(item, true, ns)) == null)) throw new InterruptedException(); if (v == TIMED_OUT) throw new TimeoutException(); diff --git a/src/java.base/share/classes/java/util/concurrent/ForkJoinTask.java b/src/java.base/share/classes/java/util/concurrent/ForkJoinTask.java --- a/src/java.base/share/classes/java/util/concurrent/ForkJoinTask.java +++ b/src/java.base/share/classes/java/util/concurrent/ForkJoinTask.java @@ -1230,14 +1230,13 @@ /** * Immediately performs the base action of this task and returns * true if, upon return from this method, this task is guaranteed - * to have completed normally. This method may return false - * otherwise, to indicate that this task is not necessarily - * complete (or is not known to be complete), for example in - * asynchronous actions that require explicit invocations of - * completion methods. This method may also throw an (unchecked) - * exception to indicate abnormal exit. This method is designed to - * support extensions, and should not in general be called - * otherwise. + * to have completed. This method may return false otherwise, to + * indicate that this task is not necessarily complete (or is not + * known to be complete), for example in asynchronous actions that + * require explicit invocations of completion methods. This method + * may also throw an (unchecked) exception to indicate abnormal + * exit. This method is designed to support extensions, and should + * not in general be called otherwise. * * @return {@code true} if this task is known to have completed normally */ diff --git a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java --- a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java +++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java @@ -121,9 +121,9 @@ * other calls to {@code compareAndSet} and {@code set}, but not * necessarily with respect to other changes in the field. * - *

May fail - * spuriously and does not provide ordering guarantees, so is - * only rarely an appropriate alternative to {@code compareAndSet}. + *

This operation may fail spuriously and does not provide + * ordering guarantees, so is only rarely an appropriate + * alternative to {@code compareAndSet}. * * @param obj An object whose field to conditionally set * @param expect the expected value diff --git a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java --- a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java +++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java @@ -124,9 +124,9 @@ * other calls to {@code compareAndSet} and {@code set}, but not * necessarily with respect to other changes in the field. * - *

May fail - * spuriously and does not provide ordering guarantees, so is - * only rarely an appropriate alternative to {@code compareAndSet}. + *

This operation may fail spuriously and does not provide + * ordering guarantees, so is only rarely an appropriate + * alternative to {@code compareAndSet}. * * @param obj An object whose field to conditionally set * @param expect the expected value diff --git a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicMarkableReference.java b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicMarkableReference.java --- a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicMarkableReference.java +++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicMarkableReference.java @@ -110,14 +110,12 @@ } /** - * Atomically sets the value of both the reference and mark - * to the given update values if the - * current reference is {@code ==} to the expected reference - * and the current mark is equal to the expected mark. - * - *

May fail - * spuriously and does not provide ordering guarantees, so is - * only rarely an appropriate alternative to {@code compareAndSet}. + * Atomically sets the value of both the reference and mark to the + * given update values if the current reference is {@code ==} to + * the expected reference and the current mark is equal to the + * expected mark. This operation may fail spuriously and does not + * provide ordering guarantees, so is only rarely an + * appropriate alternative to {@code compareAndSet}. * * @param expectedReference the expected value of the reference * @param newReference the new value for the reference diff --git a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java --- a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java +++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java @@ -143,9 +143,9 @@ * other calls to {@code compareAndSet} and {@code set}, but not * necessarily with respect to other changes in the field. * - *

May fail - * spuriously and does not provide ordering guarantees, so is - * only rarely an appropriate alternative to {@code compareAndSet}. + *

This operation may fail spuriously and does not provide + * ordering guarantees, so is only rarely an appropriate + * alternative to {@code compareAndSet}. * * @param obj An object whose field to conditionally set * @param expect the expected value diff --git a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicStampedReference.java b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicStampedReference.java --- a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicStampedReference.java +++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicStampedReference.java @@ -110,14 +110,12 @@ } /** - * Atomically sets the value of both the reference and stamp - * to the given update values if the - * current reference is {@code ==} to the expected reference - * and the current stamp is equal to the expected stamp. - * - *

May fail - * spuriously and does not provide ordering guarantees, so is - * only rarely an appropriate alternative to {@code compareAndSet}. + * Atomically sets the value of both the reference and stamp to + * the given update values if the current reference is {@code ==} + * to the expected reference and the current stamp is equal to the + * expected stamp. This operation may fail spuriously and does not + * provide ordering guarantees, so is only rarely an + * appropriate alternative to {@code compareAndSet}. * * @param expectedReference the expected value of the reference * @param newReference the new value for the reference diff --git a/src/java.base/share/classes/java/util/concurrent/atomic/DoubleAccumulator.java b/src/java.base/share/classes/java/util/concurrent/atomic/DoubleAccumulator.java --- a/src/java.base/share/classes/java/util/concurrent/atomic/DoubleAccumulator.java +++ b/src/java.base/share/classes/java/util/concurrent/atomic/DoubleAccumulator.java @@ -280,7 +280,7 @@ /** * Returns a - * + * * SerializationProxy * representing the state of this instance. * diff --git a/src/java.base/share/classes/java/util/concurrent/atomic/DoubleAdder.java b/src/java.base/share/classes/java/util/concurrent/atomic/DoubleAdder.java --- a/src/java.base/share/classes/java/util/concurrent/atomic/DoubleAdder.java +++ b/src/java.base/share/classes/java/util/concurrent/atomic/DoubleAdder.java @@ -239,7 +239,7 @@ /** * Returns a - * + * * SerializationProxy * representing the state of this instance. * diff --git a/src/java.base/share/classes/java/util/concurrent/atomic/LongAccumulator.java b/src/java.base/share/classes/java/util/concurrent/atomic/LongAccumulator.java --- a/src/java.base/share/classes/java/util/concurrent/atomic/LongAccumulator.java +++ b/src/java.base/share/classes/java/util/concurrent/atomic/LongAccumulator.java @@ -271,7 +271,7 @@ /** * Returns a - * + * * SerializationProxy * representing the state of this instance. * diff --git a/src/java.base/share/classes/java/util/concurrent/atomic/LongAdder.java b/src/java.base/share/classes/java/util/concurrent/atomic/LongAdder.java --- a/src/java.base/share/classes/java/util/concurrent/atomic/LongAdder.java +++ b/src/java.base/share/classes/java/util/concurrent/atomic/LongAdder.java @@ -241,7 +241,7 @@ /** * Returns a - * + * * SerializationProxy * representing the state of this instance. * diff --git a/src/java.base/share/classes/java/util/concurrent/locks/LockSupport.java b/src/java.base/share/classes/java/util/concurrent/locks/LockSupport.java --- a/src/java.base/share/classes/java/util/concurrent/locks/LockSupport.java +++ b/src/java.base/share/classes/java/util/concurrent/locks/LockSupport.java @@ -199,10 +199,11 @@ * Disables the current thread for thread scheduling purposes, for up to * the specified waiting time, unless the permit is available. * - *

If the permit is available then it is consumed and the call - * returns immediately; otherwise the current thread becomes disabled - * for thread scheduling purposes and lies dormant until one of four - * things happens: + *

If the specified waiting time is zero or negative, the + * method does nothing. Otherwise, if the permit is available then + * it is consumed and the call returns immediately; otherwise the + * current thread becomes disabled for thread scheduling purposes + * and lies dormant until one of four things happens: * *