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] UseArraysAsList with method call · Issue #3867 · pmd/pmd Closed DescriptionAffects PMD Version: 6.43.0 Rule: UseArraysAsList Description: When calling a method on the array element and adding the result, the rule should not be triggered. Code Sample demonstrating the issue: import java.util.ArrayList; import java.util.List; public class Test { public void foo(Integer[] ints) { // could just use Arrays.asList(ints) List<Integer> l= new ArrayList<>(100); for (int i=0; i< 100; i++) { l.add(ints[i]); } List<Integer> anotherList = new ArrayList<>(); for (int i=0; i< 100; i++) { anotherList.add(ints[i].toString()); // line 13 - false positive } } } Expected outcome: PMD reports a violation at line 13, 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. |