portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r551863 - /portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/JetspeedNavigationalStateCodec.java
Date Fri, 29 Jun 2007 12:03:54 GMT
Author: ate
Date: Fri Jun 29 05:03:53 2007
New Revision: 551863

URL: http://svn.apache.org/viewvc?view=rev&rev=551863
Log:
JS2-739: Improve Algorithms for Resource Validation and Template Localization
- replace expensive StringUtils.replace(...) with more optimal inline code

see: https://issues.apache.org/jira/browse/JS2-739

Modified:
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/JetspeedNavigationalStateCodec.java

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/JetspeedNavigationalStateCodec.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/JetspeedNavigationalStateCodec.java?view=diff&rev=551863&r1=551862&r2=551863
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/JetspeedNavigationalStateCodec.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/JetspeedNavigationalStateCodec.java
Fri Jun 29 05:03:53 2007
@@ -25,7 +25,6 @@
 import javax.portlet.WindowState;
 
 import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.lang.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.jetspeed.JetspeedActions;
@@ -554,8 +553,7 @@
     protected String decodeParameters(String value, String characterEncoding)
     throws UnsupportedEncodingException
     {
-        value = StringUtils.replace(value,"-","/");
-        value = StringUtils.replace(value,"_","=");
+        value = value.replace('-','/').replace('_','=');
         if ( characterEncoding != null )
         {
             return new String(Base64.decodeBase64(value.getBytes(characterEncoding)), characterEncoding);
@@ -587,9 +585,7 @@
         {
             value = new String(Base64.encodeBase64(value.getBytes()));
         }
-        value = StringUtils.replace(value,"/","-");
-        value = StringUtils.replace(value,"=","_");
-        return value;
+        return value.replace('/','-').replace('=','_');
     }
 
     protected String encodeArgument( String argument, char escape )



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


Mime
View raw message