Menu

#1421 InsufficientStringBufferDeclaration false positve?

New Tickets
open
nobody
None
PMD
3-Major
Bug
5.4.0
InsufficientStringBufferDeclaration
2015-10-05
2015-10-05
No

Hi,

maybe I have a false positve.

final StringBuilder query = new StringBuilder(128).append("Select {").append(BankDataModel.PK).append("} from {").append(BankDataModel._TYPECODE).append("} where {").append(BankDataModel.NUMBER).append("}=?number");

PMD.InsufficientStringBufferDeclaration dont realize that the constructor is initialized with 128 and think its16 (default).

final StringBuilder query = new StringBuilder(128); //no PMD warning 
query.append("Select {").append(BankDataModel.PK).append("} from {").append(BankDataModel._TYPECODE).append("} where {").append(BankDataModel.NUMBER).append("}=?number");

Thanks,
Mark

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.