src/java.base/share/classes/sun/security/ssl/ServerNameExtension.java

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

@@ -265,15 +265,15 @@
     }
 
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
+        sb.append("Extension ").append(type).append(", server_name: ");
         for (SNIServerName sniName : sniMap.values()) {
-            sb.append("[" + sniName + "]");
+            sb.append('[').append(sniName).append(']');
         }
-
-        return "Extension " + type + ", server_name: " + sb;
+        return sb.toString();
     }
 
     private static class UnknownServerName extends SNIServerName {
         UnknownServerName(int code, byte[] encoded) {
             super(code, encoded);