Author: markt
Date: Mon Jun 24 20:41:16 2013
New Revision: 1496208

URL: http://svn.apache.org/r1496208
Log:
Fix an i18n TODO

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

Modified: 
tomcat/trunk/java/org/apache/tomcat/websocket/server/LocalStrings.properties
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/server/LocalStrings.properties?rev=1496208&r1=1496207&r2=1496208&view=diff
==============================================================================
--- 
tomcat/trunk/java/org/apache/tomcat/websocket/server/LocalStrings.properties 
(original)
+++ 
tomcat/trunk/java/org/apache/tomcat/websocket/server/LocalStrings.properties 
Mon Jun 24 20:41:16 2013
@@ -22,6 +22,8 @@ serverContainer.pojoDeploy=POJO class [{
 serverContainer.servletContextMismatch=Attempted to register a POJO annotated 
for WebSocket at path [{0}] in the ServletContext with context path [{1}] when 
the WebSocket ServerContainer is allocated to the ServletContext with context 
path [{2}]
 serverContainer.servletContextMissing=No ServletContext was specified
 
+uriTemplate.invalidSegment=The segment [{0}] is not valid in the provided path 
[{1}]
+
 wsHttpUpgradeHandler.destroyFailed=Failed to close WebConnection while 
destroying the WebSocket HttpUpgradeHandler
 wsHttpUpgradeHandler.noPreInit=The preInit() method must be called to 
configure the WebSocket HttpUpgradeHandler before the container calls init(). 
Usually, this means the Servlet that created the WsHttpUpgradeHandler instance 
should also call preInit()
 

Modified: tomcat/trunk/java/org/apache/tomcat/websocket/server/UriTemplate.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/server/UriTemplate.java?rev=1496208&r1=1496207&r2=1496208&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/websocket/server/UriTemplate.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/server/UriTemplate.java Mon 
Jun 24 20:41:16 2013
@@ -22,12 +22,17 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.tomcat.util.res.StringManager;
+
 /**
  * Extracts path parameters from URIs used to create web socket connections
  * using the URI template defined for the associated Endpoint.
  */
 public class UriTemplate {
 
+    private static final StringManager sm =
+            StringManager.getManager(Constants.PACKAGE_NAME);
+
     private final String normalized;
     private final List<Segment> segments = new ArrayList<>();
     private final boolean hasParameters;
@@ -55,8 +60,8 @@ public class UriTemplate {
                 normalized.append('}');
             } else {
                 if (segment.contains("{") || segment.contains("}")) {
-                    // TODO i18n
-                    throw new IllegalArgumentException();
+                    throw new IllegalArgumentException(sm.getString(
+                            "uriTemplate.invalidSegment", segment, path));
                 }
                 normalized.append(segment);
             }



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

Reply via email to