harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lian...@apache.org
Subject svn commit: r513624 - in /harmony/enhanced/classlib/trunk/modules/luni/src: main/java/java/io/ObjectStreamClass.java test/java/tests/api/java/io/ObjectStreamFieldTest.java
Date Fri, 02 Mar 2007 05:45:24 GMT
Author: liangyx
Date: Thu Mar  1 21:45:21 2007
New Revision: 513624

URL: http://svn.apache.org/viewvc?view=rev&rev=513624
Log:
ObjectInputStream.readFields loses the offset attribute when deserializing fields

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectStreamClass.java
    harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/ObjectStreamFieldTest.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectStreamClass.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectStreamClass.java?view=diff&rev=513624&r1=513623&r2=513624
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectStreamClass.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectStreamClass.java
Thu Mar  1 21:45:21 2007
@@ -677,6 +677,7 @@
                 ObjectStreamField field = fields[j];
                 if (name.equals(field.getName())) {
                     loadField.setUnshared(field.isUnshared());
+                    loadField.setOffset(field.getOffset());
                     break;
                 }
             }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/ObjectStreamFieldTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/ObjectStreamFieldTest.java?view=diff&rev=513624&r1=513623&r2=513624
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/ObjectStreamFieldTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/ObjectStreamFieldTest.java
Thu Mar  1 21:45:21 2007
@@ -217,6 +217,10 @@
         assertEquals("Richard", getField.get("s", null));
         
         assertTrue(objectStreamClass.getField("s").getTypeString() == "Ljava/lang/String;");
+        
+        assertEquals(0, objectStreamClass.getField("d").getOffset());
+        assertEquals(1, objectStreamClass.getField("i").getOffset());
+        assertEquals(2, objectStreamClass.getField("s").getOffset());
     }
 
 	/**



Mime
View raw message