Community
Participate
Working Groups
Build Identifier: 3.7 Code that is of the form: public String foo() { StringBuffer buffer = new StringBuffer(); buffer.append("stuff"); return buffer.toString() } can be promoted to StringBuilder (if the compiler compliance is >= 1.5) without any loss of function. An informational/warning dialog noting the construction and destruction of a StringBuffer inside a single method (i.e. does not escape through field, inner class binding etc.) is guaranteed to be handled by a single thread and so can use the StringBuilder which doesn't have synchronized semantics. Reproducible: Always
*** This bug has been marked as a duplicate of bug 128020 ***