harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lian...@apache.org
Subject svn commit: r515492 - in /harmony/enhanced/classlib/trunk/modules/luni/src: main/java/java/net/ main/java/org/apache/harmony/luni/platform/ test/java/tests/api/java/net/
Date Wed, 07 Mar 2007 08:35:53 GMT
Author: liangyx
Date: Wed Mar  7 00:35:52 2007
New Revision: 515492

URL: http://svn.apache.org/viewvc?view=rev&rev=515492
Log:
Apply patch for HARMONY-3265([classlib][luni]java.net.ServerSocket fails to call the OSNetworkSystem.oneTimeInitialization.)

Added:
    harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/TestServerSocketInit.java
  (with props)
Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/ServerSocket.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java
    harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/ServerSocketTest.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?view=diff&rev=515492&r1=515491&r2=515492
==============================================================================
--- 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 Mar  7 00:35:52 2007
@@ -21,6 +21,7 @@
 import java.nio.channels.ServerSocketChannel;
 
 import org.apache.harmony.luni.net.SocketImplProvider;
+import org.apache.harmony.luni.platform.Platform;
 
 import org.apache.harmony.luni.util.Msg;
 
@@ -43,6 +44,10 @@
     private boolean isBound;
 
     private boolean isClosed;
+    
+    static {
+        Platform.getNetworkSystem().oneTimeInitialization(true);
+    }
 
     /**
      * Construct a ServerSocket, which is not bound to any port. The default

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java?view=diff&rev=515492&r1=515491&r2=515492
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java
Wed Mar  7 00:35:52 2007
@@ -721,9 +721,8 @@
     public void oneTimeInitialization(boolean jcl_supports_ipv6){
         if (!isNetworkInited){
             oneTimeInitializationImpl(jcl_supports_ipv6);
-        } else {
             isNetworkInited = true;
-        }
+        } 
     }
     
     native void oneTimeInitializationImpl (boolean jcl_supports_ipv6);

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/ServerSocketTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/ServerSocketTest.java?view=diff&rev=515492&r1=515491&r2=515492
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/ServerSocketTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/ServerSocketTest.java
Wed Mar  7 00:35:52 2007
@@ -35,6 +35,7 @@
 import java.util.Properties;
 
 import tests.support.Support_Configuration;
+import tests.support.Support_Exec;
 
 public class ServerSocketTest extends SocketTestCase {
 
@@ -891,6 +892,15 @@
         } catch (SocketException e) {
             // expected
         }
+    }
+    
+    /**
+     * Regression for HARMONY-3265
+     * @throws Exception
+     */
+    public void test_ServerSocket_init() throws Exception {
+        String[] args = new String[]{"tests.api.java.net.TestServerSocketInit"};
+        Support_Exec.execJava(args, null, true);
     }
 
     static class MockSocketImpl extends SocketImpl {

Added: harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/TestServerSocketInit.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/TestServerSocketInit.java?view=auto&rev=515492
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/TestServerSocketInit.java
(added)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/TestServerSocketInit.java
Wed Mar  7 00:35:52 2007
@@ -0,0 +1,13 @@
+package tests.api.java.net;
+
+import java.io.IOException;
+import java.net.ServerSocket;
+
+public class TestServerSocketInit {
+
+    public static void main(String[] args) throws IOException {
+        ServerSocket serverSocket = new ServerSocket();
+        serverSocket.setReuseAddress(true);
+        serverSocket.close();
+    }
+}

Propchange: harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/TestServerSocketInit.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message