changeset 9829:2488b51a3638

8039520: More atomicity of atomic updates Reviewed-by: dl, skoivu, igerasim
author chegar
date Thu, 24 Apr 2014 16:59:02 +0100
parents fe5e55a55075
children ac7b95c88ba0
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	Wed Apr 23 09:07:02 2014 -1000
+++ b/src/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java	Thu Apr 24 16:59:02 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");