incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awi...@apache.org
Subject svn commit: r535338 - in /incubator/adffaces/trunk/trinidad/trinidad-impl/src: main/java/org/apache/myfaces/trinidadinternal/convert/ main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ main/java/org/apache/myfaces/trinidadinternal/ui/a...
Date Fri, 04 May 2007 18:08:46 GMT
Author: awiner
Date: Fri May  4 11:08:45 2007
New Revision: 535338

URL: http://svn.apache.org/viewvc?view=rev&rev=535338
Log:
Migrate a bunch of StringBuffers to StringBuilders

Modified:
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/AutoSubmitUtils.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/XhtmlUtils.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/action/ActionUtils.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/action/FireAction.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/action/FirePartialAction.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/ColorPaletteRenderer.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/XhtmlLafUtils.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/XhtmlLafUtilsTest.java

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java?view=diff&rev=535338&r1=535337&r2=535338
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java
Fri May  4 11:08:45 2007
@@ -168,13 +168,13 @@
           .getRequestMap();
 
       // this fetch could be at the place where we append, but has been
-      // moved ahead to optimize use of StringBuffer
+      // moved ahead to optimize use of StringBuilder
       String jsPattern = getJSPattern(context);
 
       // FIX - figure out size!!!
       // 65 chars for javascript + length of jspattern + 12 chars for
       // tranforming to name in the worst case.
-      StringBuffer buff = new StringBuffer(77 + jsPattern.length());
+      StringBuilder buff = new StringBuilder(77 + jsPattern.length());
 
       if (requestMap.get(_PATTERN_WRITTEN_KEY) == null)
       {
@@ -387,7 +387,7 @@
     TimeZone zone = (TimeZone) tZone.clone();
 
     // set the id as "GMT Sign Hours : Minutes"
-    StringBuffer zoneId = new StringBuffer(9);
+    StringBuilder zoneId = new StringBuilder(9);
     int rawOffset = zone.getRawOffset();
 
     if (rawOffset < 0)
@@ -451,7 +451,7 @@
         && getSecondaryPattern() != null)
     {
       int length = getSecondaryPattern().length() * 2 + 2;
-      StringBuffer outBuffer = new StringBuffer(length);
+      StringBuilder outBuffer = new StringBuilder(length);
       _escapePattern(outBuffer, getSecondaryPattern());
       return outBuffer.toString();
     }
@@ -466,7 +466,7 @@
         if (secondaryPattern != null)
           length = length + 3 + secondaryPattern.length() * 2;
 
-        StringBuffer outBuffer = new StringBuffer(length);
+        StringBuilder outBuffer = new StringBuilder(length);
         jsPattern = _getEscapedPattern(outBuffer, datePattern, secondaryPattern);
       } else
       {
@@ -477,7 +477,7 @@
   }
 
   // get the escaped form of the pattern
-  private static void _escapePattern(StringBuffer buffer, String pattern)
+  private static void _escapePattern(StringBuilder buffer, String pattern)
   {
     buffer.append('\'');
     XhtmlUtils.escapeJS(buffer, pattern);
@@ -501,7 +501,7 @@
     }
   }
 
-  private static String _getEscapedPattern(StringBuffer buffer, String pattern,
+  private static String _getEscapedPattern(StringBuilder buffer, String pattern,
       String secondaryPattern)
   {
     if (secondaryPattern != null)

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/AutoSubmitUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/AutoSubmitUtils.java?view=diff&rev=535338&r1=535337&r2=535338
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/AutoSubmitUtils.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/AutoSubmitUtils.java
Fri May  4 11:08:45 2007
@@ -59,7 +59,7 @@
     if (childCount == 0)
       return null;
       
-    StringBuffer buffer = null;
+    StringBuilder builder = null;
     for(UIComponent child : (List<UIComponent>)comp.getChildren())
     {
       if (child instanceof UIParameter)
@@ -70,28 +70,28 @@
         if ((value == null) || (name == null))
           continue;
 
-        if (buffer == null)
-          buffer = new StringBuffer();
+        if (builder == null)
+          builder = new StringBuilder();
           
         // Add a comma if needed
-        if (buffer.length() > 0)
-          buffer.append(',');
+        if (builder.length() > 0)
+          builder.append(',');
         
         // Add the name and value, and in both cases
         // wrap in single quotes and escape it - we don't
         // know for sure if the name will be a legit JS identifier
-        buffer.append('\'');
-        buffer.append(XhtmlUtils.escapeJS(name));
-        buffer.append("':'");
-        buffer.append(XhtmlUtils.escapeJS(value.toString()));
-        buffer.append('\'');
+        builder.append('\'');
+        builder.append(XhtmlUtils.escapeJS(name));
+        builder.append("':'");
+        builder.append(XhtmlUtils.escapeJS(value.toString()));
+        builder.append('\'');
       }
     }
     
-    if (buffer == null)
+    if (builder == null)
       return null;
       
-    return buffer.toString();
+    return builder.toString();
   }
     
   public static String getFullPageSubmitScript(
@@ -126,30 +126,30 @@
       length += (1 + extraParams.length());
     }
 
-    StringBuffer buffer = new StringBuffer(length);
-    buffer.append(startString);
-    buffer.append(formName);
-    buffer.append(immediate ? "',0," : "',1,");
+    StringBuilder builder = new StringBuilder(length);
+    builder.append(startString);
+    builder.append(formName);
+    builder.append(immediate ? "',0," : "',1,");
 
-    buffer.append("{source:");
-    _appendJSParameter(buffer, source);
+    builder.append("{source:");
+    _appendJSParameter(builder, source);
 
     if (event != null)
     {
-      buffer.append(",event:");
-      _appendJSParameter(buffer, event);
+      builder.append(",event:");
+      _appendJSParameter(builder, event);
     }
 
     if (extraParams != null)
     {
-      buffer.append(",");
-      buffer.append(extraParams);
+      builder.append(",");
+      builder.append(extraParams);
     }
 
-    buffer.append('}');
-    buffer.append(endString);
+    builder.append('}');
+    builder.append(endString);
 
-    return buffer.toString();
+    return builder.toString();
   }
 
   /**
@@ -161,17 +161,17 @@
    */
   public static String getPartialGetScript(String destination)
   {
-    // Pre-compute StringBuffer size
+    // Pre-compute StringBuilder size
     int length = _FIRE_PARTIAL_CHANGE_START.length() +
                  _FIRE_PARTIAL_CHANGE_END.length()   +
                  destination.length();
 
-    StringBuffer buffer = new StringBuffer(length);
-    buffer.append(_FIRE_PARTIAL_CHANGE_START);
-    buffer.append(destination);
-    buffer.append(_FIRE_PARTIAL_CHANGE_END);
+    StringBuilder builder = new StringBuilder(length);
+    builder.append(_FIRE_PARTIAL_CHANGE_START);
+    builder.append(destination);
+    builder.append(_FIRE_PARTIAL_CHANGE_END);
 
-    return buffer.toString();
+    return builder.toString();
   }
 
   public static String getSubmitScript(
@@ -231,48 +231,48 @@
       length += (3 + extraParams.length());
     }
 
-    // Create the buffer
-    StringBuffer buffer = new StringBuffer(length);
+    // Create the builder
+    StringBuilder builder = new StringBuilder(length);
 
     // Build up the script
-    buffer.append(startString);
-    buffer.append(formName);
-    buffer.append("\',");
-    buffer.append(immediate ? "0" : "1");
-
-    buffer.append(",");
-    _appendJSParameter(buffer, event); // eventName
-    buffer.append(",");
-    _appendJSParameter(buffer, source); // source
+    builder.append(startString);
+    builder.append(formName);
+    builder.append("\',");
+    builder.append(immediate ? "0" : "1");
+
+    builder.append(",");
+    _appendJSParameter(builder, event); // eventName
+    builder.append(",");
+    _appendJSParameter(builder, source); // source
 
     if (extraParams != null)
     {
-      buffer.append(",{");
-      buffer.append(extraParams);
-      buffer.append("}");
+      builder.append(",{");
+      builder.append(extraParams);
+      builder.append("}");
     }
 
-    buffer.append(endString);
-    return buffer.toString();
+    builder.append(endString);
+    return builder.toString();
   }
 
-  // Appends a parameter to a JavaScript function call buffer
+  // Appends a parameter to a JavaScript function call builder
   private static void _appendJSParameter(
-    StringBuffer buffer,
+    StringBuilder builder,
     String value
     )
   {
     if (value == null)
     {
-      buffer.append("0");
+      builder.append("0");
     }
     else
     {
       // double escape in-quotes string
       // e.g. "\'" + escapeJS("a'b") + "\'" -> "\'a\\\'b\'"
-      buffer.append("\'");
-      XhtmlUtils.escapeJS(buffer, value, true, 2);
-      buffer.append("\'");
+      builder.append("\'");
+      XhtmlUtils.escapeJS(builder, value, true, 2);
+      builder.append("\'");
     }
   }
 

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/XhtmlUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/XhtmlUtils.java?view=diff&rev=535338&r1=535337&r2=535338
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/XhtmlUtils.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/XhtmlUtils.java
Fri May  4 11:08:45 2007
@@ -101,8 +101,8 @@
                  XhtmlConstants.COMPOSITE_ID_EXTENSION.length();
     if (suffix != null)
       length += suffix.length();
-    StringBuffer compID
-      = new StringBuffer(length);
+    StringBuilder compID
+      = new StringBuilder(length);
     compID.append(baseid);
     compID.append(XhtmlConstants.COMPOSITE_ID_EXTENSION);
     if (suffix != null)
@@ -233,23 +233,23 @@
     // allocate enough room for the constants plus double the length
     // of the possible-escaped strings
     //
-    StringBuffer outBuffer = new StringBuffer(15 +
+    StringBuilder outBuilder = new StringBuilder(15 +
                                               evh1Length * 2 +
                                               3 +
                                               evh2Length * 2 +
                                               18);
 
-    outBuffer.append("return _chain('");
-    _escapeSingleQuotes(outBuffer, evh1);
-    outBuffer.append("','");
-    _escapeSingleQuotes(outBuffer, evh2);
+    outBuilder.append("return _chain('");
+    _escapeSingleQuotes(outBuilder, evh1);
+    outBuilder.append("','");
+    _escapeSingleQuotes(outBuilder, evh2);
 
     if ( shortCircuit )
-      outBuffer.append("',this,event,true)");
+      outBuilder.append("',this,event,true)");
     else
-      outBuffer.append("',this,event)");
+      outBuilder.append("',this,event)");
 
-    return outBuffer.toString();
+    return outBuilder.toString();
   }
 
 
@@ -281,16 +281,16 @@
   {
     int charCount = inString.length();
 
-    StringBuffer outBuffer = new StringBuffer(charCount * 2);
+    StringBuilder outBuilder = new StringBuilder(charCount * 2);
 
-    escapeJS(outBuffer, inString, inQuotes);
+    escapeJS(outBuilder, inString, inQuotes);
 
     // since we only add characters, if the character count is different, we
     // will have a different output string, otherwise, reuse the input string,
     // as it is unchanged
-    if (charCount != outBuffer.length())
+    if (charCount != outBuilder.length())
     {
-      return outBuffer.toString();
+      return outBuilder.toString();
     }
     else
     {
@@ -304,11 +304,11 @@
    * quotes.
    */
   public static void escapeJS(
-    StringBuffer outBuffer,
+    StringBuilder outBuilder,
     String       inString
     )
   {
-    escapeJS(outBuffer, inString, false /* inQuotes */);
+    escapeJS(outBuilder, inString, false /* inQuotes */);
   }
 
 
@@ -317,11 +317,11 @@
    * quotes.
    */
   public static void escapeJS(
-    StringBuffer outBuffer,
+    StringBuilder outBuilder,
     String       inString,
     boolean      inQuotes)
   {
-    escapeJS(outBuffer, inString, inQuotes, 1 /* escapeCount */);
+    escapeJS(outBuilder, inString, inQuotes, 1 /* escapeCount */);
   }
 
   /**
@@ -329,7 +329,7 @@
    * quotes.
    */
   public static void escapeJS(
-    StringBuffer outBuffer,
+    StringBuilder outBuilder,
     String       inString,
     boolean      inQuotes,
     int          escapeCount
@@ -357,17 +357,17 @@
         }
 
         // handle double-escaping case
-        // eg. "\'" + escapeJS(buffer,"a'b",true,2) + "\'" -> "\'a\\\'b\'"
+        // eg. "\'" + escapeJS(builder,"a'b",true,2) + "\'" -> "\'a\\\'b\'"
         for (int j=0; j < leadSlashCount; j++)
         {
-          outBuffer.append('\\');
+          outBuilder.append('\\');
         }
 
         // always escape quotes
-        outBuffer.append('\\');
+        outBuilder.append('\\');
 
         // output the current character
-        outBuffer.append(currChar);
+        outBuilder.append(currChar);
       }
       else
       {
@@ -375,8 +375,8 @@
         {
           if (currChar > 255)
           {
-            outBuffer.append("\\u");
-            _appendHexString(outBuffer, currChar, 4);
+            outBuilder.append("\\u");
+            _appendHexString(outBuilder, currChar, 4);
           }
           else
           {
@@ -386,16 +386,16 @@
               if (currChar == '\\')
               {
                 // escape all \'s in strings
-                outBuffer.append('\\');
+                outBuilder.append('\\');
               }
 
               // output the current character
-              outBuffer.append(currChar);
+              outBuilder.append(currChar);
             }
             else
             {
-              outBuffer.append("\\x");
-              _appendHexString(outBuffer, currChar, 2);
+              outBuilder.append("\\x");
+              _appendHexString(outBuilder, currChar, 2);
             }
           }
         }
@@ -403,10 +403,10 @@
         {
           // Double up backslashes (see bug 1676002)
           if (currChar == '\\')
-            outBuffer.append('\\');
+            outBuilder.append('\\');
 
           // output the current character
-          outBuffer.append(currChar);
+          outBuilder.append(currChar);
         }
       }
 
@@ -417,7 +417,7 @@
   }
 
   private static void _appendHexString(
-    StringBuffer buffer,
+    StringBuilder builder,
     int          number,
     int          minDigits
     )
@@ -430,11 +430,11 @@
 
     if (zeroPadding > 0)
     {
-      buffer.append('0');
+      builder.append('0');
 
       while (zeroPadding > 1)
       {
-        buffer.append('0');
+        builder.append('0');
         zeroPadding--;
       }
     }
@@ -446,12 +446,12 @@
       }
     }
 
-    buffer.append(hexString);
+    builder.append(hexString);
   }
 
 
   private static void _escapeSingleQuotes(
-    StringBuffer outBuffer,
+    StringBuilder outBuilder,
     String       inString
     )
   {
@@ -476,16 +476,16 @@
         }
 
         // always escape quotes
-        outBuffer.append('\\');
+        outBuilder.append('\\');
       }
       else if ((currChar == '\\') && inQuotes)
       {
         // escape all \'s in strings
-        outBuffer.append('\\');
+        outBuilder.append('\\');
       }
 
       // output the current character
-      outBuffer.append(currChar);
+      outBuilder.append(currChar);
 
       // keep track of the previous character to determine whether
       // single quotes are escaped

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/action/ActionUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/action/ActionUtils.java?view=diff&rev=535338&r1=535337&r2=535338
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/action/ActionUtils.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/action/ActionUtils.java
Fri May  4 11:08:45 2007
@@ -108,7 +108,7 @@
    */
   public static void appendClientParameters(
     UIXRenderingContext context,
-    StringBuffer     buffer,
+    StringBuilder     buffer,
     Parameter[]      parameters
     )
   {
@@ -121,7 +121,7 @@
    */
   public static void appendClientParameters(
     UIXRenderingContext context,
-    StringBuffer     buffer,
+    StringBuilder     buffer,
     Parameter[]      parameters,
     String           event,
     String           source
@@ -135,7 +135,7 @@
    */
   public static void appendClientParameters(
     UIXRenderingContext context,
-    StringBuffer     buffer,
+    StringBuilder     buffer,
     Parameter[]      parameters,
     String           event,
     String           source,
@@ -246,7 +246,7 @@
     )
   {
     int bufLen = 1 + base.length() + getClientParametersSize(context, params);
-    StringBuffer buffer = new StringBuffer(bufLen);
+    StringBuilder buffer = new StringBuilder(bufLen);
     buffer.append(base);
     if (base.indexOf('?') < 0)
       buffer.append('?');
@@ -255,7 +255,7 @@
   }
 
   static void appendURLParameters(
-    StringBuffer buffer,
+    StringBuilder buffer,
     Parameter[]  params
     )
   {
@@ -266,7 +266,7 @@
   }
 
   static void appendURLParameter(
-    StringBuffer buffer,
+    StringBuilder buffer,
     Parameter    param
     )
   {
@@ -275,7 +275,7 @@
 
   // Append a parameter to a URL buffer
   static void appendURLParameter(
-    StringBuffer buffer,
+    StringBuilder buffer,
     String       name,
     String       value
     )

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/action/FireAction.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/action/FireAction.java?view=diff&rev=535338&r1=535337&r2=535338
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/action/FireAction.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/action/FireAction.java
Fri May  4 11:08:45 2007
@@ -215,7 +215,7 @@
                                parameters);
 
     // Create the buffer
-    StringBuffer buffer = new StringBuffer(length);
+    StringBuilder buffer = new StringBuilder(length);
 
     // Build up the script
     buffer.append(startScript);
@@ -282,8 +282,8 @@
                                parameters);
 
     // Create the buffer
-    StringBuffer buffer = new StringBuffer(length);
-    StringBuffer urlBuffer = new StringBuffer(length);
+    StringBuilder buffer = new StringBuilder(length);
+    StringBuilder urlBuffer = new StringBuilder(length);
     // Add the start script
     buffer.append(startScript);
 
@@ -524,7 +524,7 @@
 
   // Appends a parameter to a JavaScript function call buffer
   protected static void appendJSParameter(
-    StringBuffer buffer,
+    StringBuilder buffer,
     String value
     )
   {
@@ -547,7 +547,7 @@
 
   // Append a parameter to a URL buffer
   protected static void appendURLParameter(
-    StringBuffer buffer,
+    StringBuilder buffer,
     String       name,
     String       value
     )
@@ -558,7 +558,7 @@
 
   protected static void appendClientParameters(
     UIXRenderingContext context,
-    StringBuffer     buffer,
+    StringBuilder     buffer,
     Parameter[]      parameters
     )
   {

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/action/FirePartialAction.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/action/FirePartialAction.java?view=diff&rev=535338&r1=535337&r2=535338
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/action/FirePartialAction.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/action/FirePartialAction.java
Fri May  4 11:08:45 2007
@@ -203,7 +203,7 @@
                                parameters);
 
     // Create the buffer
-    StringBuffer buffer = new StringBuffer(length);
+    StringBuilder buffer = new StringBuilder(length);
 
     // Build up the script
     buffer.append(startScript);
@@ -449,7 +449,7 @@
 
   // Appends a parameter to our buffer
   private static void _appendBooleanParameter(
-    StringBuffer buffer,
+    StringBuilder buffer,
     boolean      value
     )
   {

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/ColorPaletteRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/ColorPaletteRenderer.java?view=diff&rev=535338&r1=535337&r2=535338
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/ColorPaletteRenderer.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/ColorPaletteRenderer.java
Fri May  4 11:08:45 2007
@@ -172,7 +172,7 @@
       writer.endElement("script");
     }
 
-    StringBuffer onCellClick = null;
+    StringBuilder onCellClick = null;
     int onCellClickLength = 0;
 
     if (isNetscape)
@@ -180,7 +180,7 @@
       Object id = getID(context, node);
       if (id == null)
         id = "null";
-      onCellClick = new StringBuffer(id.toString().length() +
+      onCellClick = new StringBuilder(id.toString().length() +
                                      onColorSelect.toString().length() +
                                      16);
       onCellClick.append("_onCPSel('");
@@ -376,7 +376,7 @@
           Object id = getID(context, node);
           if (id == null)
             id = "null";
-          StringBuffer sb = new StringBuffer(id.toString().length() +
+          StringBuilder sb = new StringBuilder(id.toString().length() +
                                              onColorSelect.toString().length() +
                                              21);
           sb.append("_onCPSel('");

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/XhtmlLafUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/XhtmlLafUtils.java?view=diff&rev=535338&r1=535337&r2=535338
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/XhtmlLafUtils.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/XhtmlLafUtils.java
Fri May  4 11:08:45 2007
@@ -113,7 +113,7 @@
       keyValueSize = 20;
 
     // add 2 for starting and ending curly quotes
-    StringBuffer jsObject = new StringBuffer(keyValueSize + 2);
+    StringBuilder jsObject = new StringBuilder(keyValueSize + 2);
 
     // append start of javascript property
     jsObject.append('{');
@@ -691,7 +691,7 @@
    * quotes.
    */
   public static void escapeJS(
-    StringBuffer outBuffer,
+    StringBuilder outBuffer,
     String       inString
     )
   {
@@ -704,7 +704,7 @@
    * quotes.
    */
   public static void escapeJS(
-    StringBuffer outBuffer,
+    StringBuilder outBuffer,
     String       inString,
     boolean      inQuotes)
   {
@@ -716,7 +716,7 @@
    * quotes.
    */
   public static void escapeJS(
-    StringBuffer outBuffer,
+    StringBuilder outBuffer,
     String       inString,
     boolean      inQuotes,
     int          escapeCount
@@ -1012,13 +1012,13 @@
   // Note: This method is only called by BodyRenderer and
   // ScriptBufferingResponseWriter, so we're leaving in
   // package-private.
-  static StringBuffer __stripJSComments(StringBuffer buffer)
+  static StringBuilder __stripJSComments(StringBuilder buffer)
   {
     // We avoid reallocating the buffer until we actually
     // find a comment.  Actually, we should never find any
     // comments in production code.  This method really shouldn't
     // be needed, but we do all of this work just to be extra safe.
-    StringBuffer strippedBuffer = null;
+    StringBuilder strippedBuffer = null;
 
     // We use a simple state machine to track whether or not
     // we are inside a comment or opening/closing a comment.
@@ -1052,7 +1052,7 @@
             // Copy the contents up to the start of the
             // comment into the strippedBuffer.
             if (strippedBuffer == null)
-              strippedBuffer = new StringBuffer(length);
+              strippedBuffer = new StringBuilder(length);
 
             strippedBuffer.append(buffer.substring(startIndex, i - 1));
           }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/XhtmlLafUtilsTest.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/XhtmlLafUtilsTest.java?view=diff&rev=535338&r1=535337&r2=535338
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/XhtmlLafUtilsTest.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/XhtmlLafUtilsTest.java
Fri May  4 11:08:45 2007
@@ -39,7 +39,7 @@
   public void testEscapeInQuoteJS()
   {
     String raw = "a'b";
-    StringBuffer escaped = new StringBuffer();
+    StringBuilder escaped = new StringBuilder();
     XhtmlLafUtils.escapeJS(escaped, raw, true);
     assertEquals("a\\\'b", escaped.toString());
   }
@@ -50,7 +50,7 @@
   public void testDoubleEscapeInQuoteJS()
   {
     String raw = "a'b";
-    StringBuffer escaped = new StringBuffer();
+    StringBuilder escaped = new StringBuilder();
     XhtmlLafUtils.escapeJS(escaped, raw, true, 2);
     assertEquals("a\\\\\\\'b", escaped.toString());
   }



Mime
View raw message