You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Adam Heath <do...@brainfood.com> on 2008/08/14 22:36:24 UTC

a StringBuffer/StringBuilder anti-pattern

--
StringBuffer sb = new StringBuffer();
sb.append("foo");
while (...) {
     ...
     sb.append("message [" + variable + "] more text [" + another + "]");
}
--

Using '+' when adding to a StringBuffer/StringBuilder allocates more 
temporary objects.