src/java.desktop/share/classes/javax/swing/JColorChooser.java

Print this page
rev 10520 : 8055723[client]: Replace concat String to append in StringBuilder parameters
Contributed-by: Otavio Santana <otaviojava@java.net>

@@ -541,21 +541,21 @@
      * be <code>null</code>.
      *
      * @return  a string representation of this <code>JColorChooser</code>
      */
     protected String paramString() {
-        StringBuilder chooserPanelsString = new StringBuilder("");
-        for (int i=0; i<chooserPanels.length; i++) {
-            chooserPanelsString.append("[" + chooserPanels[i].toString()
-                                       + "]");
-        }
-        String previewPanelString = (previewPanel != null ?
-                                     previewPanel.toString() : "");
-
-        return super.paramString() +
-        ",chooserPanels=" + chooserPanelsString.toString() +
-        ",previewPanel=" + previewPanelString;
+        StringBuilder chooserPanelsString = new StringBuilder();
+        for (AbstractColorChooserPanel panel : chooserPanels) {
+            chooserPanelsString.append('[').append(panel)
+                               .append(']');
+        }
+        String previewPanelString = (previewPanel != null ? previewPanel
+                .toString() : "");
+
+        return super.paramString() + ",chooserPanels="
+                + chooserPanelsString.toString() + ",previewPanel="
+                + previewPanelString;
     }
 
 /////////////////
 // Accessibility support
 ////////////////