Fixes issue #591 (http://code.google.com/p/google-web-toolkit/issues/detail?id=591) and adds a regression test to StringBufferTest. Also contains some formatting and cleanup. Patch by: tobyr Review by: me git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@816 8db76d5a-ed1c-0410-87a9-c151d255dfc7