harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r438798 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io: ObjectOutputStream.java ObjectStreamClass.java
Date Thu, 31 Aug 2006 05:18:01 GMT
Author: pyang
Date: Wed Aug 30 22:18:01 2006
New Revision: 438798

URL: http://svn.apache.org/viewvc?rev=438798&view=rev
Log:
Patch applied for HARMONY-1342([classlib][luni]ObjectStreamClass define in Serialization should
set SerialVersionUID to zero if the class is enum)

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectOutputStream.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectStreamClass.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectOutputStream.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectOutputStream.java?rev=438798&r1=438797&r2=438798&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectOutputStream.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectOutputStream.java
Wed Aug 30 22:18:01 2006
@@ -1965,8 +1965,6 @@
             throws IOException {
         // write classDesc, classDesc for enum is different
         ObjectStreamClass classDesc = ObjectStreamClass.lookup(theClass);
-        // SUID of enum is 0L
-        classDesc.setSerialVersionUID(0L);
         // set flag for enum, the flag is (SC_SERIALIZABLE | SC_ENUM)
         classDesc.setFlags((byte)(SC_SERIALIZABLE|SC_ENUM));
         Integer previousHandle = objectsWritten.get(classDesc);
@@ -1999,7 +1997,6 @@
             if (null != superClass) {
             	// super class is also enum
                 superClass.setFlags((byte)(SC_SERIALIZABLE|SC_ENUM));
-                superClass.setSerialVersionUID(0L);
                 writeEnumDesc(superClass.forClass(), unshared);
             } else {
                 output.writeByte(TC_NULL);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectStreamClass.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectStreamClass.java?rev=438798&r1=438797&r2=438798&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectStreamClass.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectStreamClass.java
Wed Aug 30 22:18:01 2006
@@ -195,8 +195,8 @@
         if (computeSUID) {
             // Lazy computation, to save speed & space
             declaredFields = cl.getDeclaredFields();
-            result.setSerialVersionUID(computeSerialVersionUID(cl,
-                    declaredFields));
+            result.setSerialVersionUID(cl.isEnum() ? 0
+                    : computeSerialVersionUID(cl, declaredFields));
         }
 
         boolean serializable = isSerializable(cl);



Mime
View raw message