replace StringBuffer with StringBuilder
add testcase for ticket 2689
solved ticket https://issues.jboss.org/browse/RAILO-2689