src/jdk.jcmd/share/classes/sun/tools/jstat/SyntaxException.java

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

@@ -63,24 +63,24 @@
     }
 
     public SyntaxException(int lineno, Set<String> expected, Token found) {
         StringBuilder msg = new StringBuilder();
 
-        msg.append("Syntax error at line " + lineno + ": Expected one of \'");
+        msg.append("Syntax error at line ").append(lineno).append(": Expected one of \'");
 
         boolean first = true;
         for (Iterator<String> i = expected.iterator(); i.hasNext(); /* empty */) {
             String keyWord = i.next();
             if (first) {
                 msg.append(keyWord);
                 first = false;
             } else {
-                msg.append("|" + keyWord);
+                msg.append('|').append(keyWord);
             }
         }
 
-        msg.append("\', Found " + found.toMessage());
+        msg.append("\', Found ").append(found.toMessage());
         message = msg.toString();
     }
 
     public String getMessage() {
         return message;