activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1438751 - /activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Router.scala
Date Fri, 25 Jan 2013 23:01:01 GMT
Author: chirino
Date: Fri Jan 25 23:01:01 2013
New Revision: 1438751

URL: http://svn.apache.org/viewvc?rev=1438751&view=rev
Log:
Fixes APLO-289: spaces in topic IDs get "\u0020" inserted before them

Modified:
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Router.scala

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Router.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Router.scala?rev=1438751&r1=1438750&r2=1438751&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Router.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Router.scala
Fri Jan 25 23:01:01 2013
@@ -72,9 +72,6 @@ object DestinationAddress {
   
   def escape(value:String) = {
     val rc = new StringBuffer(value.length())
-    def unicode_encode(c:Char) = {
-      rc.append("\\u%04x".format(c.toInt))
-    }
     var i=0;
     while( i < value.length() ) {
       val c = value.charAt(i);
@@ -92,10 +89,11 @@ object DestinationAddress {
         rc.append("\\w")
       }  else if( c == '.' ) {
         rc.append("\\d")
-      } else if  ( c < '!' || c > '~' ) {
-        unicode_encode(c)
+      } else if  ( c < ' ' || c > '~' ) {
+        rc.append("\\u%04x".format(c.toInt))
+      } else {
+        rc.append(c)
       }
-      rc.append(c)
       i+=1
     }
     rc.toString



Mime
View raw message