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] StringToString false-positive with local method name confusion · Issue #3977 · pmd/pmd Closed DescriptionAffects PMD Version: 6.43.0 Rule: StringToString Description: When you have a method chain call and at the end the The rule searches always for local method declarations, but that's wrong - at least for method chains. Code Sample demonstrating the issue: public class StringToString_FP { private String s; public void print(A a) { this.s = a.getB().getC().toString(); // line 5 - false positive this.s = String.valueOf(a.getB().getC()); // workaround System.out.println(s); } public String getC() { return ""; } } interface A { B getB(); } interface B { Character getC(); }
Expected outcome: PMD reports a violation at line 5, but that's wrong. That's a false positive. Activity
MetadataMetadataAssigneesLabelsa:false-positivePMD flags a piece of code that is not problematic 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. |