8039520: More atomicity of atomic updates
authorchegar
Thu, 24 Apr 2014 16:52:45 +0100
changeset 25545 c7a4604c5766
parent 25544 dca3eee75c1a
child 25546 65d6855a3407
8039520: More atomicity of atomic updates Reviewed-by: dl, skoivu, igerasim
jdk/src/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java
--- a/jdk/src/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java	Thu Apr 24 21:09:05 2014 +0400
+++ b/jdk/src/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java	Thu Apr 24 16:52:45 2014 +0100
@@ -334,6 +334,8 @@
 
             if (vclass != fieldClass)
                 throw new ClassCastException();
+            if (vclass.isPrimitive())
+                throw new IllegalArgumentException("Must be reference type");
 
             if (!Modifier.isVolatile(modifiers))
                 throw new IllegalArgumentException("Must be volatile type");