You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2013/11/20 22:06:24 UTC

svn commit: r1543948 - in /tomcat/trunk/java/org/apache/tomcat/websocket: LocalStrings.properties WsRemoteEndpointImplBase.java

Author: markt
Date: Wed Nov 20 21:06:24 2013
New Revision: 1543948

URL: http://svn.apache.org/r1543948
Log:
Fix a couple of log message TODOs

Modified:
    tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties
    tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java

Modified: tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties?rev=1543948&r1=1543947&r2=1543948&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties (original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties Wed Nov 20 21:06:24 2013
@@ -60,7 +60,7 @@ wsRemoteEndpoint.flushOnCloseFailed=Flus
 wsRemoteEndpoint.inProgress=Unexpected state. Please report a bug. Message will not be sent because the WebSocket session is currently sending another message
 wsRemoteEndpoint.invalidEncoder=The specified encoder of type [{0}] could not be instantiated
 wsRemoteEndpoint.noEncoder=No encoder specified for object of class [{0}]
-wsRemoteEndpoint.wrongState=Remote endpoint was in state [{0}] but state [{1}] is required for this action
+wsRemoteEndpoint.wrongState=The remote endpoint was in state [{0}] which is an invalid state for called method
 
 # Note the following message is used as a close reason in a WebSocket control
 # frame and therefore must be 123 bytes (not characters) or less in length.

Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java?rev=1543948&r1=1543947&r2=1543948&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java Wed Nov 20 21:06:24 2013
@@ -992,8 +992,10 @@ public abstract class WsRemoteEndpointIm
                  // NO-OP. Leave state as is.
                 } else {
                     // Should never happen
-                    // TODO Better message
-                    throw new IllegalStateException();
+                    // The if ... else ... blocks above should cover all states
+                    // permitted by the preceding checkState() call
+                    throw new IllegalStateException(
+                            "BUG: This code should never be called");
                 }
             }
         }
@@ -1004,8 +1006,8 @@ public abstract class WsRemoteEndpointIm
                     return;
                 }
             }
-            // TODO Better (well, any) message
-            throw new IllegalStateException();
+            throw new IllegalStateException(
+                    sm.getString("wsRemoteEndpoint.wrongState", this.state));
         }
     }
 



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