Is there a rule in FindBugs or PMD that will warn when StringBuffer, which is synchronized, can be safely replaced with StringBuilder?
For example when a StringBuffer variable reference never escapes (to another Thread) from a method it would be possible to safely replace it with StringBuilder.
http://fb-contrib.sf.net has one, called LocalSynchronizedCollections
this is a plugin for findbugs.