src/java.base/share/classes/javax/crypto/CryptoPermission.java

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

@@ -367,26 +367,28 @@
      * format: '("ClassName" "algorithm" "keysize" "exemption_mechanism")'.
      *
      * @return information about this CryptoPermission.
      */
     public String toString() {
-        StringBuilder buf = new StringBuilder(100);
-        buf.append("(CryptoPermission " + alg + " " + maxKeySize);
+        StringBuilder sb = new StringBuilder(100);
+        sb.append("(CryptoPermission ").append(alg).append(' ')
+                .append(maxKeySize);
         if (algParamSpec != null) {
             if (algParamSpec instanceof RC2ParameterSpec) {
-                buf.append(" , effective " +
-                    ((RC2ParameterSpec)algParamSpec).getEffectiveKeyBits());
+                sb.append(" , effective ")
+                        .append(((RC2ParameterSpec) algParamSpec)
+                                .getEffectiveKeyBits());
             } else if (algParamSpec instanceof RC5ParameterSpec) {
-                buf.append(" , rounds " +
-                    ((RC5ParameterSpec)algParamSpec).getRounds());
+                sb.append(" , rounds ").append(
+                        ((RC5ParameterSpec) algParamSpec).getRounds());
             }
         }
         if (exemptionMechanism != null) { // OPTIONAL
-            buf.append(" " + exemptionMechanism);
+            sb.append(' ').append(exemptionMechanism);
         }
-        buf.append(")");
-        return buf.toString();
+        sb.append(')');
+        return sb.toString();
     }
 
     private boolean impliesExemptionMechanism(String exemptionMechanism) {
         if (this.exemptionMechanism == null) {
             return true;