Ryan Gustafson - 2008-04-21

Logged In: YES
user_id=342470
Originator: NO

For anyone considering implementing this, these are two separate feature requests.

1) Enhancement of UseStringBufferForStringAppends to recommend different implementation when only concatenating 2-3 Strings. It might be nice if the messaging/description of UseStringBufferForStringAppends referred to StringBuilder/StringBuffer both, and perhaps could dynamically recommend the appropriate construct to use. Failure to use StringBuilder though would have this Rule be producing multiple violations, reducing it's orthogonal utility (or increasing it's complexity if we made it configurable behavior via properties).
2) Therefore, a new migration rule to recommend using StringBuilder over StringBuffer is likely the approach most consisten with current PMD rules.