You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by tr...@apache.org on 2007/11/09 12:51:19 UTC

svn commit: r593501 - /mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoAcceptor.java

Author: trustin
Date: Fri Nov  9 03:51:18 2007
New Revision: 593501

URL: http://svn.apache.org/viewvc?rev=593501&view=rev
Log:
* More sanity check in AbstractIoAcceptor
* Updated exception messages in AbstractIoAcceptor

Modified:
    mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoAcceptor.java

Modified: mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoAcceptor.java
URL: http://svn.apache.org/viewvc/mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoAcceptor.java?rev=593501&r1=593500&r2=593501&view=diff
==============================================================================
--- mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoAcceptor.java (original)
+++ mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoAcceptor.java Fri Nov  9 03:51:18 2007
@@ -123,12 +123,17 @@
         synchronized (bindLock) {
             if (bound) {
                 throw new IllegalStateException("Already bound to: "
-                        + getLocalAddress());
+                        + getLocalAddresses());
             }
 
             if (getHandler() == null) {
                 throw new IllegalStateException("handler is not set.");
             }
+            
+            if (localAddresses.isEmpty()) {
+                throw new IllegalStateException(
+                        "no local addresses were specified.");
+            }
 
             try {
                 doBind();
@@ -138,7 +143,7 @@
                 throw e;
             } catch (Throwable e) {
                 throw new RuntimeIoException(
-                        "Failed to bind to: " + getLocalAddress(), e);
+                        "Failed to bind to: " + getLocalAddresses(), e);
             }
             bound = true;
         }
@@ -157,7 +162,7 @@
                 throw e;
             } catch (Throwable e) {
                 throw new RuntimeIoException(
-                        "Failed to unbind from: " + getLocalAddress(), e);
+                        "Failed to unbind from: " + getLocalAddresses(), e);
             }
             bound = false;
         }