You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by te...@apache.org on 2009/11/04 14:37:52 UTC
svn commit: r832735 -
/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/ServerSocket.java
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());
+ }
}
/**