Author: markt
Date: Mon Nov 23 22:18:22 2015
New Revision: 1715980

URL: http://svn.apache.org/viewvc?rev=1715980&view=rev
Log:
Fix warnings

Modified:
    tomcat/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java

Modified: 
tomcat/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java?rev=1715980&r1=1715979&r2=1715980&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java Mon 
Nov 23 22:18:22 2015
@@ -186,6 +186,7 @@ public class WsWebSocketContainer implem
     }
 
 
+    @SuppressWarnings("resource") // socketChannel is closed
     @Override
     public Session connectToServer(Endpoint endpoint,
             ClientEndpointConfig clientEndpointConfiguration, URI path)
@@ -310,7 +311,9 @@ public class WsWebSocketContainer implem
                 }
             } catch (TimeoutException | InterruptedException | 
ExecutionException |
                     EOFException e) {
-                channel.close();
+                if (channel != null) {
+                    channel.close();
+                }
                 throw new DeploymentException(
                         
sm.getString("wsWebSocketContainer.httpRequestFailed"), e);
             }



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

Reply via email to