src/java.management/share/classes/javax/management/relation/Role.java

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

@@ -224,21 +224,21 @@
      * Returns a string describing the role.
      *
      * @return the description of the role.
      */
     public String toString() {
-        StringBuilder result = new StringBuilder();
-        result.append("role name: " + name + "; role value: ");
-        for (Iterator<ObjectName> objNameIter = objectNameList.iterator();
-             objNameIter.hasNext();) {
+        StringBuilder sb = new StringBuilder();
+        sb.append("role name: ").append(name).append("; role value: ");
+        for (Iterator<ObjectName> objNameIter = objectNameList.iterator(); objNameIter
+                .hasNext();) {
             ObjectName currObjName = objNameIter.next();
-            result.append(currObjName.toString());
+            sb.append(currObjName);
             if (objNameIter.hasNext()) {
-                result.append(", ");
+                sb.append(", ");
             }
         }
-        return result.toString();
+        return sb.toString();
     }
 
     //
     // Misc
     //