RFR 8024103: AtomicLongArray getAndAccumulate/accumulateAndGet have int type for new value arg

Chris Hegarty chris.hegarty at oracle.com
Mon Sep 2 12:10:16 UTC 2013


This is a small issue that was spotted by one of the TCK engineers. 
Trivially, the args should be long.

Doug has already pull this change into his CVS. This RFR is to pull the 
change into JDK8.

diff --git 
a/src/share/classes/java/util/concurrent/atomic/AtomicLongArray.java 
b/src/share/classes/java/util/concurrent/atomic/AtomicLongArray.java
--- a/src/share/classes/java/util/concurrent/atomic/AtomicLongArray.java
+++ b/src/share/classes/java/util/concurrent/atomic/AtomicLongArray.java
@@ -303,7 +303,7 @@ public class AtomicLongArray implements
       * @return the previous value
       * @since 1.8
       */
-    public final long getAndAccumulate(int i, int x,
+    public final long getAndAccumulate(int i, long x,
                                        LongBinaryOperator 
accumulatorFunction) {
          long offset = checkedByteOffset(i);
          long prev, next;
@@ -329,7 +329,7 @@ public class AtomicLongArray implements
       * @return the updated value
       * @since 1.8
       */
-    public final long accumulateAndGet(int i, int x,
+    public final long accumulateAndGet(int i, long x,
                                        LongBinaryOperator 
accumulatorFunction) {
          long offset = checkedByteOffset(i);
          long prev, next;

-Chris.



More information about the core-libs-dev mailing list