src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/P11KeyStore.java

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

@@ -194,28 +194,27 @@
             } else if (type == ATTR_CLASS_SKEY) {
                 sb.append("\ttype=[secret key]\n");
             } else if (type == ATTR_CLASS_CERT) {
                 sb.append("\ttype=[trusted cert]\n");
             }
-            sb.append("\tlabel=[" + label + "]\n");
+            sb.append("\tlabel=[").append(label).append("]\n");
             if (id == null) {
                 sb.append("\tid=[null]\n");
             } else {
-                sb.append("\tid=" + P11KeyStore.getID(id) + "\n");
+                sb.append("\tid=").append(P11KeyStore.getID(id)).append('\n');
             }
-            sb.append("\ttrusted=[" + trusted + "]\n");
-            sb.append("\tmatched=[" + matched + "]\n");
+            sb.append("\ttrusted=[").append(trusted).append("]\n");
+            sb.append("\tmatched=[").append(matched).append("]\n");
             if (cert == null) {
                 sb.append("\tcert=[null]\n");
             } else {
-                sb.append("\tcert=[\tsubject: " +
-                        cert.getSubjectX500Principal() +
-                        "\n\t\tissuer: " +
-                        cert.getIssuerX500Principal() +
-                        "\n\t\tserialNum: " +
-                        cert.getSerialNumber().toString() +
-                        "]");
+                sb.append("\tcert=[\tsubject: ")
+                        .append(cert.getSubjectX500Principal())
+                        .append("\n\t\tissuer: ")
+                        .append(cert.getIssuerX500Principal())
+                        .append("\n\t\tserialNum: ")
+                        .append(cert.getSerialNumber()).append(']');
             }
             return sb.toString();
         }
     }