changeset 25545:c7a4604c5766

8039520: More atomicity of atomic updates Reviewed-by: dl, skoivu, igerasim
author chegar
date Thu, 24 Apr 2014 16:52:45 +0100
parents dca3eee75c1a
children 65d6855a3407
files jdk/src/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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");