changeset 7345:3bb943c6ff7d jdk7u65-b10

8039520: More atomicity of atomic updates Reviewed-by: dl, skoivu, chegar
author igerasim
date Fri, 25 Apr 2014 13:33:04 +0400
parents a290dfe75bdb
children e67383c77c6c 86ff4a9d4269
files src/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java	Thu Apr 24 12:08:05 2014 -0700
+++ b/src/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java	Fri Apr 25 13:33:04 2014 +0400
@@ -221,6 +221,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");