harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r832735 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/ServerSocket.java
Date Wed, 04 Nov 2009 13:37:52 GMT
Author: tellison
Date: Wed Nov  4 13:37:51 2009
New Revision: 832735

URL: http://svn.apache.org/viewvc?rev=832735&view=rev
Log:
Part of HARMONY-6367 ([classlib] Some Methods doesn't have security Permissions check as compared
to SUN JDK)
Move the checkAccept security test into the protected implAccept(Socket) method.

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/ServerSocket.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/ServerSocket.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/ServerSocket.java?rev=832735&r1=832734&r2=832735&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/ServerSocket.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/ServerSocket.java
Wed Nov  4 13:37:51 2009
@@ -152,14 +152,7 @@
 
         Socket aSocket = new Socket();
         try {
-            synchronized (this) {
-                implAccept(aSocket);
-            }
-            SecurityManager security = System.getSecurityManager();
-            if (security != null) {
-                security.checkAccept(aSocket.getInetAddress().getHostAddress(),
-                        aSocket.getPort());
-            }
+            implAccept(aSocket);
         } catch (SecurityException e) {
             aSocket.close();
             throw e;
@@ -274,8 +267,15 @@
      *             if the connection cannot be accepted.
      */
     protected final void implAccept(Socket aSocket) throws IOException {
-        impl.accept(aSocket.impl);
-        aSocket.accepted();
+        synchronized (this) {
+            impl.accept(aSocket.impl);
+            aSocket.accepted();
+        }
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
+            security.checkAccept(aSocket.getInetAddress().getHostAddress(),
+                    aSocket.getPort());
+        }
     }
 
     /**



Mime
View raw message