src/java.security.acl/share/classes/sun/security/acl/AclEntryImpl.java

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

@@ -136,28 +136,32 @@
 
     /**
      * Return a string representation of  the contents of the ACL entry.
      */
     public String toString() {
-        StringBuffer s = new StringBuffer();
-        if (negative)
-          s.append("-");
-        else
-          s.append("+");
-        if (user instanceof Group)
-            s.append("Group.");
-        else
-            s.append("User.");
-        s.append(user + "=");
+        StringBuffer sb = new StringBuffer();
+        if (negative) {
+            sb.append('-');
+        } else {
+            sb.append('+');
+        }
+        if (user instanceof Group) {
+            sb.append("Group.");
+        } else {
+            sb.append("User.");
+        }
+        sb.append(user).append('=');
+
         Enumeration<Permission> e = permissions();
-        while(e.hasMoreElements()) {
+        while (e.hasMoreElements()) {
             Permission p = e.nextElement();
-            s.append(p);
-            if (e.hasMoreElements())
-                s.append(",");
+            sb.append(p);
+            if (e.hasMoreElements()) {
+                sb.append(',');
+            }
         }
-        return new String(s);
+        return sb.toString();
     }
 
     /**
      * Clones an AclEntry.
      */