Skip to content

Latest commit

 

History

History
8 lines (5 loc) · 519 Bytes

InsufficientStringBufferDeclaration.md

File metadata and controls

8 lines (5 loc) · 519 Bytes

InsufficientStringBufferDeclaration

Category: pmd
Rule Key: pmd:InsufficientStringBufferDeclaration


Failing to pre-size a StringBuffer properly could cause it to re-size many times during runtime. This rule checks the characters that are actually passed into StringBuffer.append(), but represents a best guess worst case scenario. An empty StringBuffer constructor initializes the object to 16 characters. This default is assumed if the length of the constructor can not be determined.