harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lian...@apache.org
Subject svn commit: r513596 - in /harmony/enhanced/classlib/trunk/modules/luni/src: main/java/java/io/ObjectStreamField.java test/java/tests/api/java/io/ObjectStreamFieldTest.java
Date Fri, 02 Mar 2007 02:28:15 GMT
Author: liangyx
Date: Thu Mar  1 18:28:14 2007
New Revision: 513596

URL: http://svn.apache.org/viewvc?view=rev&rev=513596
Log:
Make sure the same type string is return for the same class

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectStreamField.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/ObjectStreamField.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectStreamField.java?view=diff&rev=513596&r1=513595&r2=513596
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectStreamField.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectStreamField.java
Thu Mar  1 18:28:14 2007
@@ -97,7 +97,7 @@
             throw new NullPointerException();
         }
         this.name = name;
-        this.typeString = signature.replace('.', '/');
+        this.typeString = signature.replace('.', '/').intern();
         this.isDeserialized = true;
     }
 

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=513596&r1=513595&r2=513596
==============================================================================
--- 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 18:28:14 2007
@@ -137,6 +137,9 @@
 		assertTrue("getTypeString returned: " + holaField.getTypeString(),
 				holaField.getTypeString().indexOf("Object") >= 0);
 		assertNull("Primitive types' strings should be null", hamField.getTypeString());
+        
+        ObjectStreamField osf = new ObjectStreamField("s", String.class, true);
+        assertTrue(osf.getTypeString() == "Ljava/lang/String;");
 	}
 
 	/**
@@ -212,6 +215,8 @@
         assertEquals(1000, getField.get("i", null));
         assertEquals(SerializableObject2.today, getField.get("d", null));
         assertEquals("Richard", getField.get("s", null));
+        
+        assertTrue(objectStreamClass.getField("s").getTypeString() == "Ljava/lang/String;");
     }
 
 	/**



Mime
View raw message