GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — [java] InsufficientStringBufferDeclaration: False negatives with String constants · Issue #3857 · pmd/pmd Closed Labels a:false-negativePMD doesn't flag a problematic piece of code Milestone DescriptionAffects PMD Version: Rule: InsufficientStringBufferDeclaration Description: Rule InsufficientStringBufferDeclaration is supposed to prevent unnecessary resizing. In this case, the size of the constant String Hence PMD should report a violation at line 10 (at point 2). Code Sample demonstrating the issue: import java.util.ArrayList; import java.util.List; public class Example { public List<String> list = new ArrayList<>(); public static final String PRE = "The size of list is: "; // point 1: 21 characters, exceed default 16 public void func() { StringBuilder builder = new StringBuilder(); // point 2: improper initial capacity, false negative builder.append(PRE); // point 3 } } Expected outcome: PMD should report a violation at line 10, but doesn't. This is a false-negative. Running PMD through: [CLI] Activity
MetadataMetadataAssigneesLabelsa:false-negativePMD doesn't flag a problematic piece of code TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |