TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
TIOBE - Java Coding Standard
Search

Rule:  StringandStringBuffer8Checked automatically with code checker

Synopsis:Combine StringBuffer.append calls, if possible
Language:Java
Severity Level:4
Category:StringandStringBuffer


Description:
Consecutively calling StringBuffer.append with String literals
public class Foo {
 private void bar() {
   StringBuffer buf = new StringBuffer();
   buf.append("Hello").append(" ").append("World"); //bad
   buf.append("Hello World");//good
 }
}