commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcucchi...@apache.org
Subject svn commit: r1198668 - /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlOps.java
Date Mon, 07 Nov 2011 09:18:07 GMT
Author: mcucchiara
Date: Mon Nov  7 09:18:07 2011
New Revision: 1198668

URL: http://svn.apache.org/viewvc?rev=1198668&view=rev
Log:
OGNL-38 - Use StringBuilder instead of StringBuffer.

Modified:
    commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlOps.java

Modified: commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlOps.java
URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlOps.java?rev=1198668&r1=1198667&r2=1198668&view=diff
==============================================================================
--- commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlOps.java (original)
+++ commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlOps.java Mon Nov 
7 09:18:07 2011
@@ -1208,13 +1208,14 @@ public abstract class OgnlOps
 
     public static String getEscapeString( String value )
     {
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
 
-        for ( int i = 0, icount = value.length(); i < icount; i++ )
+        int length = value.length();
+        for ( int i = 0; i < length; i++ )
         {
             result.append( getEscapedChar( value.charAt( i ) ) );
         }
-        return new String( result );
+        return result.toString();
     }
 
     public static String getEscapedChar( char ch )



Mime
View raw message