src/java.base/share/classes/com/sun/crypto/provider/DHParameters.java

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

@@ -129,16 +129,18 @@
      * Returns a formatted string describing the parameters.
      */
     protected String engineToString() {
         String LINE_SEP = System.getProperty("line.separator");
 
-        StringBuilder sb
-            = new StringBuilder("SunJCE Diffie-Hellman Parameters:"
-                               + LINE_SEP + "p:" + LINE_SEP
-                               + Debug.toHexString(this.p)
-                               + LINE_SEP + "g:" + LINE_SEP
-                               + Debug.toHexString(this.g));
-        if (this.l != 0)
-            sb.append(LINE_SEP + "l:" + LINE_SEP + "    " + this.l);
+        StringBuilder sb = new StringBuilder();
+        sb.append("SunJCE Diffie-Hellman Parameters:").append(LINE_SEP)
+                .append("p:").append(LINE_SEP)
+                .append(Debug.toHexString(this.p)).append(LINE_SEP)
+                .append("g:").append(LINE_SEP)
+                .append(Debug.toHexString(this.g));
+        if (this.l != 0) {
+            sb.append(LINE_SEP).append("l:").append(LINE_SEP).append("    ")
+                    .append(this.l);
+        }
         return sb.toString();
     }
 }