src/java.base/share/classes/java/util/Scanner.java

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

@@ -1302,24 +1302,24 @@
      * @return  The string representation of this scanner
      */
     public String toString() {
         StringBuilder sb = new StringBuilder();
         sb.append("java.util.Scanner");
-        sb.append("[delimiters=" + delimPattern + "]");
-        sb.append("[position=" + position + "]");
-        sb.append("[match valid=" + matchValid + "]");
-        sb.append("[need input=" + needInput + "]");
-        sb.append("[source closed=" + sourceClosed + "]");
-        sb.append("[skipped=" + skipped + "]");
-        sb.append("[group separator=" + groupSeparator + "]");
-        sb.append("[decimal separator=" + decimalSeparator + "]");
-        sb.append("[positive prefix=" + positivePrefix + "]");
-        sb.append("[negative prefix=" + negativePrefix + "]");
-        sb.append("[positive suffix=" + positiveSuffix + "]");
-        sb.append("[negative suffix=" + negativeSuffix + "]");
-        sb.append("[NaN string=" + nanString + "]");
-        sb.append("[infinity string=" + infinityString + "]");
+        sb.append("[delimiters=").append(delimPattern).append(']');
+        sb.append("[position=").append(position).append(']');
+        sb.append("[match valid=").append(matchValid).append(']');
+        sb.append("[need input=").append(needInput).append(']');
+        sb.append("[source closed=").append(sourceClosed).append(']');
+        sb.append("[skipped=").append(skipped).append(']');
+        sb.append("[group separator=").append(groupSeparator).append(']');
+        sb.append("[decimal separator=").append(decimalSeparator).append(']');
+        sb.append("[positive prefix=").append(positivePrefix).append(']');
+        sb.append("[negative prefix=").append(negativePrefix).append(']');
+        sb.append("[positive suffix=").append(positiveSuffix).append(']');
+        sb.append("[negative suffix=").append(negativeSuffix).append(']');
+        sb.append("[NaN string=").append(nanString).append(']');
+        sb.append("[infinity string=").append(infinityString).append(']');
         return sb.toString();
     }
 
     /**
      * Returns true if this scanner has another token in its input.