Menu

#1380 InsufficientStringBufferDeclaration false positive when literal string passed to a lookup service

PMD-5.3.4
closed
PMD
4-Minor
Bug
5.3.2
String and StringBuffer /InsufficientStringBufferDeclaration
2015-09-13
2015-07-14
Thrawn
No

InsufficientStringBufferDeclaration triggers a false positive when a literal String of sufficient length is passed to a lookup service, eg a Spring MessageSource, and then the result is appended to a StringBuilder. See attached sample class.

It's possible to work around this by extracting the literal string to a constant.

1 Attachments

Discussion

  • Andreas Dangel

    Andreas Dangel - 2015-09-13
    • status: open --> closed
    • assigned_to: Andreas Dangel
    • Milestone: New Tickets --> PMD-5.3.4
     

Log in to post a comment.