harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r549956 - in /harmony/enhanced/classlib/trunk/modules/luni/src: main/java/java/io/ObjectStreamField.java test/api/common/tests/api/java/io/ObjectStreamFieldTest.java
Date Fri, 22 Jun 2007 20:49:50 GMT
Author: tellison
Date: Fri Jun 22 13:49:50 2007
New Revision: 549956

URL: http://svn.apache.org/viewvc?view=rev&rev=549956
Log:
Fix for HARMONY-4273 (java.io.ObjectStreamField.equals(Object) method is not correct)

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectStreamField.java
    harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/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=549956&r1=549955&r2=549956
==============================================================================
--- 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
Fri Jun 22 13:49:50 2007
@@ -129,7 +129,7 @@
 
     @Override
     public boolean equals(Object arg0) {
-        return compareTo(arg0) == 0;
+        return (arg0 instanceof ObjectStreamField) && (compareTo(arg0) == 0);
     }
 
     @Override

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/io/ObjectStreamFieldTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/io/ObjectStreamFieldTest.java?view=diff&rev=549956&r1=549955&r2=549956
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/io/ObjectStreamFieldTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/io/ObjectStreamFieldTest.java
Fri Jun 22 13:49:50 2007
@@ -70,6 +70,14 @@
 		assertTrue("Used to test", true);
 	}
 
+	public void test_equalsLjava_lang_Object() {
+	    // Regression test for HARMONY-4273
+	    assertTrue(samField.equals(samField));
+	    assertFalse(samField.equals(hamField));
+	    assertFalse(samField.equals("fish"));
+	    assertFalse(samField.equals(null));
+    }
+
 	/**
 	 * @tests java.io.ObjectStreamField#compareTo(java.lang.Object)
 	 */



Mime
View raw message