Author: markt
Date: Wed Apr 13 15:00:27 2016
New Revision: 1738954

URL: http://svn.apache.org/viewvc?rev=1738954&view=rev
Log:
Clean-up.

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/net/LocalStrings.properties
    tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/LocalStrings.properties
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/LocalStrings.properties?rev=1738954&r1=1738953&r2=1738954&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/LocalStrings.properties 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/LocalStrings.properties Wed 
Apr 13 15:00:27 2016
@@ -73,6 +73,7 @@ endpoint.apr.pollUnknownEvent=A socket w
 endpoint.apr.tooManyCertFiles=More certificate files were configured than the 
AprEndpoint can handle
 endpoint.apr.remoteport=APR socket [{0}] opened with remote port [{1}]
 endpoint.jsse.noSslContext=No SSLContext could be found for the host name [{0}]
+endpoint.nio.registerFail=Failed to register socket with selector from poller
 endpoint.nio.selectorCloseFail=Failed to close selector when closing the poller
 endpoint.nio.timeoutCme=Exception during processing of timeouts. The code has 
been checked repeatedly and no concurrent modification has been found. If you 
are able to repeat this error please open a Tomcat bug and provide the steps to 
reproduce.
 endpoint.nio2.exclusiveExecutor=The NIO2 connector requires an exclusive 
executor to operate properly on shutdown

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?rev=1738954&r1=1738953&r2=1738954&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Wed Apr 13 
15:00:27 2016
@@ -615,12 +615,12 @@ public class NioEndpoint extends Abstrac
 
         @Override
         public void run() {
-            if ( interestOps == OP_REGISTER ) {
+            if (interestOps == OP_REGISTER) {
                 try {
                     
socket.getIOChannel().register(socket.getPoller().getSelector(),
                             SelectionKey.OP_READ, socketWrapper);
                 } catch (Exception x) {
-                    log.error("", x);
+                    log.error(sm.getString("endpoint.nio.registerFail"), x);
                 }
             } else {
                 final SelectionKey key = 
socket.getIOChannel().keyFor(socket.getPoller().getSelector());
@@ -628,7 +628,7 @@ public class NioEndpoint extends Abstrac
                     boolean cancel = false;
                     if (key != null) {
                         final NioSocketWrapper socketWrapper = 
(NioSocketWrapper) key.attachment();
-                        if ( socketWrapper!=null ) {
+                        if (socketWrapper != null) {
                             //we are registering the key to start with, reset 
the fairness counter.
                             int ops = key.interestOps() | interestOps;
                             socketWrapper.interestOps(ops);
@@ -639,14 +639,14 @@ public class NioEndpoint extends Abstrac
                     } else {
                         cancel = true;
                     }
-                    if ( cancel ) socket.getPoller().cancelledKey(key);
-                }catch (CancelledKeyException ckx) {
+                    if (cancel) socket.getPoller().cancelledKey(key);
+                } catch (CancelledKeyException ckx) {
                     try {
                         socket.getPoller().cancelledKey(key);
-                    }catch (Exception ignore) {}
+                    } catch (Exception ignore) {}
                 }
-            }//end if
-        }//run
+            }
+        }
 
         @Override
         public String toString() {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to