click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r990768 - /click/trunk/click/extras/src/org/apache/click/extras/tree/Tree.java
Date Mon, 30 Aug 2010 11:12:12 GMT
Author: sabob
Date: Mon Aug 30 11:12:11 2010
New Revision: 990768

URL: http://svn.apache.org/viewvc?rev=990768&view=rev
Log:
converted StringBuffer to StringBuilder

Modified:
    click/trunk/click/extras/src/org/apache/click/extras/tree/Tree.java

Modified: click/trunk/click/extras/src/org/apache/click/extras/tree/Tree.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/src/org/apache/click/extras/tree/Tree.java?rev=990768&r1=990767&r2=990768&view=diff
==============================================================================
--- click/trunk/click/extras/src/org/apache/click/extras/tree/Tree.java (original)
+++ click/trunk/click/extras/src/org/apache/click/extras/tree/Tree.java Mon Aug 30 11:12:11
2010
@@ -1284,19 +1284,19 @@ public class Tree extends AbstractContro
      * @return string specific css class to apply
      */
     protected String getExpandClass(TreeNode treeNode) {
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         if (isExpandedParent(treeNode)) {
-            buffer.append("expanded");
+            sb.append("expanded");
         } else if (treeNode.getChildren().size() > 0) {
-            buffer.append("collapsed");
+            sb.append("collapsed");
         } else {
-            buffer.append("leaf");
+            sb.append("leaf");
         }
 
         if (treeNode.isLastChild()) {
-            buffer.append("LastNode");
+            sb.append("LastNode");
         }
-        return buffer.toString();
+        return sb.toString();
     }
 
     /**
@@ -1968,9 +1968,9 @@ public class Tree extends AbstractContro
          * @return the newly create string
          */
         protected String buildString(String prefix, String infix, String postfix) {
-            StringBuffer buffer = new StringBuffer();
-            buffer.append(prefix).append(infix).append(postfix);
-            return buffer.toString();
+            StringBuilder sb = new StringBuilder();
+            sb.append(prefix).append(infix).append(postfix);
+            return sb.toString();
         }
     }
 
@@ -2009,13 +2009,13 @@ public class Tree extends AbstractContro
         @Override
         public void init(TreeNode treeNode) {
             super.init(treeNode);
-            StringBuffer tmp = new StringBuffer();
-            tmp.append("handleNodeExpansion(this,event,'").append(expandId).append("','");
-            tmp.append(iconId).append("'); handleCookie(this,event,'").append(expandId).append("','");
-            tmp.append(treeNode.getId()).append("','");
-            tmp.append(expandedCookieName).append("','");
-            tmp.append(collapsedCookieName).append("'); return false;");
-            nodeExpansionString = tmp.toString();
+            StringBuilder sb = new StringBuilder();
+            sb.append("handleNodeExpansion(this,event,'").append(expandId).append("','");
+            sb.append(iconId).append("'); handleCookie(this,event,'").append(expandId).append("','");
+            sb.append(treeNode.getId()).append("','");
+            sb.append(expandedCookieName).append("','");
+            sb.append(collapsedCookieName).append("'); return false;");
+            nodeExpansionString = sb.toString();
         }
     }
 



Mime
View raw message