harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From regi...@apache.org
Subject svn commit: r998804 - in /harmony/enhanced/java/trunk/classlib/modules/luni/src: main/java/java/net/SocketPermission.java test/api/common/org/apache/harmony/luni/tests/java/net/SocketPermissionTest.java
Date Mon, 20 Sep 2010 06:56:13 GMT
Author: regisxu
Date: Mon Sep 20 06:56:13 2010
New Revision: 998804

URL: http://svn.apache.org/viewvc?rev=998804&view=rev
Log:
The default port range of SocketPermission should be 0-65535

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

Modified: harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/net/SocketPermission.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/net/SocketPermission.java?rev=998804&r1=998803&r2=998804&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/net/SocketPermission.java
(original)
+++ harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/net/SocketPermission.java
Mon Sep 20 06:56:13 2010
@@ -300,14 +300,7 @@ public final class SocketPermission exte
        String port = hostPort.substring(host.length());
        String emptyString = ""; //$NON-NLS-1$
 
-       if (emptyString.equals(port)) {
-           // Not specified
-           portMin = 80;
-           portMax = 80;
-           return;
-       }
-       
-       if (":*".equals(port)) {
+       if (emptyString.equals(port) || ":*".equals(port)) {
            // The port range should be 0-65535
            portMin = 0;
            portMax = 65535;

Modified: harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/SocketPermissionTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/SocketPermissionTest.java?rev=998804&r1=998803&r2=998804&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/SocketPermissionTest.java
(original)
+++ harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/SocketPermissionTest.java
Mon Sep 20 06:56:13 2010
@@ -64,6 +64,11 @@ public class SocketPermissionTest extend
                 "listen");
         assertTrue("Port range error", sp3.implies(spAllPorts));
         assertTrue("Port range error", spAllPorts.implies(sp3));
+
+        SocketPermission sp4 = new SocketPermission("localhost", "listen");
+        assertEquals("Wrong name4", "localhost", sp4.getName());
+        assertTrue("Port range error", sp4.implies(spAllPorts));
+        assertTrue("Port range error", spAllPorts.implies(sp4));
     }
 
     /**



Mime
View raw message