changeset 240:5d9708346d50

6877056: SVUID calculated for java.lang.Enum is not 0L Reviewed-by: raginip
author miroslawzn
date Wed, 08 Dec 2010 10:43:16 -0800
parents e6f42f5d6d60
children 33ca1bceec2d
files src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java	Sun Dec 05 15:20:25 2010 -0800
+++ b/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java	Wed Dec 08 10:43:16 2010 -0800
@@ -85,6 +85,9 @@
 
     private static Hashtable translatedFields;
 
+    /** true if represents enum type */
+    private boolean isEnum;
+
     private static final Bridge bridge =
         (Bridge)AccessController.doPrivileged(
             new PrivilegedAction() {
@@ -359,6 +362,7 @@
         }
 
         name = cl.getName();
+        isEnum = Enum.class.isAssignableFrom(cl);
         superclass = superdesc;
         serializable = serial;
         if (!forProxyClass) {
@@ -401,7 +405,8 @@
         if (!serializable ||
             externalizable ||
             forProxyClass ||
-            name.equals("java.lang.String")) {
+            name.equals("java.lang.String") ||
+            isEnum) {
             fields = NO_FIELDS;
         } else if (serializable) {
             /* Ask for permission to override field access checks.
@@ -502,7 +507,7 @@
          *
          * NonSerializable classes have a serialVerisonUID of 0L.
          */
-         if (isNonSerializable()) {
+         if (isNonSerializable() || isEnum) {
              suid = 0L;
          } else {
              // Lookup special Serializable members using reflection.