< prev index next >

src/jdk.dev/share/classes/sun/security/tools/jarsigner/Main.java

Print this page
rev 10947 : 8055723: Replace concat String to append in StringBuilder parameters

@@ -674,18 +674,17 @@
                         sb = new StringBuffer();
                         boolean inManifest =
                             ((man.getAttributes(name) != null) ||
                              (man.getAttributes("./"+name) != null) ||
                              (man.getAttributes("/"+name) != null));
-                        sb.append(
-                          (isSigned ? rb.getString("s") : rb.getString("SPACE")) +
-                          (inManifest ? rb.getString("m") : rb.getString("SPACE")) +
-                          (inStore ? rb.getString("k") : rb.getString("SPACE")) +
-                          (inScope ? rb.getString("i") : rb.getString("SPACE")) +
-                          ((inStoreOrScope & NOT_ALIAS) != 0 ?"X":" ") +
-                          rb.getString("SPACE"));
-                        sb.append("|");
+                        sb.append(isSigned ? rb.getString("s") : rb.getString("SPACE"))
+                                .append(inManifest ? rb.getString("m") : rb.getString("SPACE"))
+                                .append(inStore ? rb.getString("k") : rb.getString("SPACE"))
+                                .append(inScope ? rb.getString("i") : rb.getString("SPACE"))
+                                .append((inStoreOrScope & NOT_ALIAS) != 0 ? 'X' : ' ')
+                                .append(rb.getString("SPACE"));
+                        sb.append('|');
                     }
 
                     // When -certs provided, display info has extra empty
                     // lines at the beginning and end.
                     if (isSigned) {

@@ -702,15 +701,19 @@
                         }
                     } else if (showcerts && !verbose.equals("all")) {
                         // Print no info for unsigned entries when -verbose:all,
                         // to be consistent with old behavior.
                         if (signatureRelated(name)) {
-                            sb.append("\n" + tab + rb.getString(
-                                    ".Signature.related.entries.") + "\n\n");
-                        } else {
-                            sb.append("\n" + tab + rb.getString(
-                                    ".Unsigned.entries.") + "\n\n");
+                            sb.append('\n')
+                                    .append(tab)
+                                    .append(rb
+                                            .getString(".Signature.related.entries."))
+                                    .append("\n\n");
+                        } else {
+                            sb.append('\n').append(tab)
+                                    .append(rb.getString(".Unsigned.entries."))
+                                    .append("\n\n");
                         }
                     }
 
                     if (verbose != null) {
                         String label = sb.toString();

@@ -1603,12 +1606,12 @@
                     (e.getCause() instanceof CertificateExpiredException ||
                      e.getCause() instanceof CertificateNotYetValidException)) {
                 // No more warning, we alreay have hasExpiredCert or notYetValidCert
             } else {
                 chainNotValidated = true;
-                sb.append(tab + rb.getString(".CertPath.not.validated.") +
-                        e.getLocalizedMessage() + "]\n");   // TODO
+                sb.append(tab).append(rb.getString(".CertPath.not.validated."))
+                        .append(e.getLocalizedMessage()).append("]\n"); // TODO
             }
         }
         String result = sb.toString();
         cacheForSignerInfo.put(signer, result);
         return result;
< prev index next >