src/java.base/share/classes/java/util/regex/Matcher.java

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

@@ -1293,18 +1293,18 @@
      * @since 1.5
      */
     public String toString() {
         StringBuilder sb = new StringBuilder();
         sb.append("java.util.regex.Matcher");
-        sb.append("[pattern=" + pattern());
+        sb.append("[pattern=").append(pattern());
         sb.append(" region=");
-        sb.append(regionStart() + "," + regionEnd());
+        sb.append(regionStart()).append(',').append(regionEnd());
         sb.append(" lastmatch=");
         if ((first >= 0) && (group() != null)) {
             sb.append(group());
         }
-        sb.append("]");
+        sb.append(']');
         return sb.toString();
     }
 
     /**
      * <p>Returns true if the end of input was hit by the search engine in