src/jdk.dev/share/classes/com/sun/tools/hat/internal/util/Misc.java

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

@@ -95,15 +95,15 @@
             } else if (ch == '\'') {
                 sb.append("'");
             } else if (ch == '&') {
                 sb.append("&amp;");
             } else if (ch < ' ') {
-                sb.append("&#" + Integer.toString(ch) + ";");
+                sb.append("&#").append((int)ch).append(';');
             } else {
                 int c = (ch & 0xFFFF);
                 if (c > 127) {
-                    sb.append("&#" + Integer.toString(c) + ";");
+                    sb.append("&#").append((int)c).append(';');
                 } else {
                     sb.append(ch);
                 }
             }
         }