harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r431849 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src: main/java/java/net/SocketPermission.java test/java/tests/api/java/net/SocketPermissionTest.java
Date Wed, 16 Aug 2006 07:05:41 GMT
Author: pyang
Date: Wed Aug 16 00:05:40 2006
New Revision: 431849

URL: http://svn.apache.org/viewvc?rev=431849&view=rev
Log:
Patch applied for HARMONY-1200 ([classlib][net] SocketPermission.implies((Permission) null))
expected false but throws NPE)

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?rev=431849&r1=431848&r2=431849&view=diff
==============================================================================
--- 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
Wed Aug 16 00:05:40 2006
@@ -238,7 +238,7 @@
 
 		// tests if the action list of p is the subset of the one of the
 		// receiver
-		if ((actionsMask & sp.actionsMask) != sp.actionsMask)
+        if (sp == null || (actionsMask & sp.actionsMask) != sp.actionsMask)
 			return false;
 
 		// only check the port range if the action string of the current object

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?rev=431849&r1=431848&r2=431849&view=diff
==============================================================================
--- 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
Wed Aug 16 00:05:40 2006
@@ -108,6 +108,10 @@
 		// Test for method boolean
 		// java.net.SocketPermission.implies(java.security.Permission)
 		assertTrue("All should imply resolve", star_All.implies(star_Resolve));
+		
+        // regression for HARMONY-1200
+        assertFalse("Null should not be implied", star_All.implies((SocketPermission)null));
+        
 		assertTrue("Equals should imply eachother", www_All
 				.implies(copyOfWww_All));
 		assertTrue("Wild should imply normal", star_All.implies(www_All));
@@ -154,6 +158,7 @@
 		PermissionCollection col = perm1.newPermissionCollection();
 		col.add(perm1);
 		assertTrue("collection should imply port 80", col.implies(perm2));
+
 	}
 
 	/**



Mime
View raw message