You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@river.apache.org by pe...@apache.org on 2012/11/20 14:39:21 UTC

svn commit: r1411656 - /river/jtsk/trunk/src/com/sun/jini/reggie/RegistrarImpl.java

Author: peter_firmstone
Date: Tue Nov 20 13:39:20 2012
New Revision: 1411656

URL: http://svn.apache.org/viewvc?rev=1411656&view=rev
Log:
Alter Reggie to throw IOException if port selected by ServerSocketFactory doesn't match requested port, or if default port not available.

Modified:
    river/jtsk/trunk/src/com/sun/jini/reggie/RegistrarImpl.java

Modified: river/jtsk/trunk/src/com/sun/jini/reggie/RegistrarImpl.java
URL: http://svn.apache.org/viewvc/river/jtsk/trunk/src/com/sun/jini/reggie/RegistrarImpl.java?rev=1411656&r1=1411655&r2=1411656&view=diff
==============================================================================
--- river/jtsk/trunk/src/com/sun/jini/reggie/RegistrarImpl.java (original)
+++ river/jtsk/trunk/src/com/sun/jini/reggie/RegistrarImpl.java Tue Nov 20 13:39:20 2012
@@ -2567,8 +2567,11 @@ class RegistrarImpl implements Registrar
 		try {
 		    listen = serverSocketFactory.createServerSocket(Constants.discoveryPort);
 		} catch (IOException e) {
-		    logger.log(
-			Levels.HANDLED, "failed to bind to default port", e);
+                    e.fillInStackTrace();
+                    throw e;
+                    // Swallowing interrupt causes difficult to diagnose test failures.
+//		    logger.log(
+//			Levels.HANDLED, "failed to bind to default port", e);
 		}
 	    }
 	    if (listen == null) {
@@ -2589,7 +2592,7 @@ class RegistrarImpl implements Registrar
 	    }
 	    this.port = listen.getLocalPort();
             logger.log(Level.FINEST, "Reggie ServerSocket local port: {0}", port);
-            if ( port >= 0 && this.port != port){
+            if ( port > 0 && this.port != port){
                 try {
                     listen.close();
                 } catch (IOException e){} // Ignore