Sonar: if/else/for/while/do statements should always use curly braces.
Replaced StringBuffer with StringBuilder.