6877056: SVUID calculated for java.lang.Enum is not 0L
authormiroslawzn
Wed, 08 Dec 2010 10:43:16 -0800
changeset 7588 cdc4ca035126
parent 7587 59f7cad43d38
child 7589 20f199a0929e
6877056: SVUID calculated for java.lang.Enum is not 0L Reviewed-by: raginip
corba/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java
--- a/corba/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java	Sun Dec 05 15:20:25 2010 -0800
+++ b/corba/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.