harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r466032 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src: main/java/java/net/SocketPermission.java test/java/tests/api/java/net/SocketPermissionTest.java
Date Fri, 20 Oct 2006 08:31:06 GMT
Author: mloenko
Date: Fri Oct 20 01:31:02 2006
New Revision: 466032

URL: http://svn.apache.org/viewvc?view=rev&rev=466032
Log:
applied patch from HARMONY-1524
[classlib][net] unexpected NPE for SocketPermission.equals(null));

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/SocketPermission.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/SocketPermissionTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/SocketPermission.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/SocketPermission.java?view=diff&rev=466032&r1=466031&r2=466032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/SocketPermission.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/SocketPermission.java
Fri Oct 20 01:31:02 2006
@@ -148,10 +148,10 @@
 	 */
 	@Override
     public boolean equals(Object o) {
-		if (this == o) {
+        if (this == o) {
             return true;
         }
-		if (this.getClass() != o.getClass()) {
+        if (o == null || this.getClass() != o.getClass()) {
             return false;
         }
 		SocketPermission sp = (SocketPermission) o;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/SocketPermissionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/SocketPermissionTest.java?view=diff&rev=466032&r1=466031&r2=466032
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/SocketPermissionTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/SocketPermissionTest.java
Fri Oct 20 01:31:02 2006
@@ -86,6 +86,9 @@
 		SocketPermission sp2 = new SocketPermission("test1.com",
 				"resolve,connect");
 		assertTrue("Different cases should be equal", sp1.equals(sp2));
+
+        // Regression for HARMONY-1524
+        assertFalse(sp1.equals(null));
 	}
 
 	/**



Mime
View raw message