In the book \"Effective Java\", Josh Bloch says that
StringBuffer is largely obsolete and should be replaced by the non-synchronized implementation \'S
Not only is synchronisation not required in most cases, it actually gives readers of your code wrong information if you nevertheless use it: namely, the reader could be led to believe that synchronisation is required where it actually isn’t.
Using a StringBuilder instead advertises the fact that you don’t expect cross-thread access.
In fact, sending data across threads should almost always be done through well-defined channels of communication anyway, not simply by accessing a synchronised string buffer. So in a way I would recommend always using a different solution, even when a StringBuffer seems appropriate at first glance.