Consecutively calls to StringBuffer/StringBuilder .append should reuse the target object. This can improve the performance. Example:
String foo = " "; StringBuffer buf = new StringBuffer(); buf.append("Hello"); // poor buf.append(foo); buf.append("World"); StringBuffer buf = new StringBuffer(); buf.append("Hello").append(foo).append("World"); // good