1 <p> The method seems to be building a String using concatenation in a loop.
2 In each iteration, the String is converted to a StringBuffer/StringBuilder,
3 appended to, and converted back to a String.
4 This can lead to a cost quadratic in the number of iterations,
5 as the growing string is recopied in each iteration. </p>
7 <p>Better performance can be obtained by using
8 a StringBuffer (or StringBuilder in Java 1.5) explicitly.</p>
14 for (int i = 0; i < field.length; ++i) {
19 StringBuffer buf = new StringBuffer();
20 for (int i = 0; i < field.length; ++i) {
23 String s = buf.toString();