You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I found a false negative about the rule AvoidArrayLoops. Please read the following case. PMD should have reported a warning at line 6, but it doesn't. However, it can detect line 7. I think line 6 and line 7 are same. Hence, this is a false negative. Thanks for your consideration.
Code Sample demonstrating the issue:
publicvoidsample() {
int[] a = newint[10];
int[] b = newint[10];
finalintc = 6;
for (inti=0;i<10;i++) {
b[i]=a[i+c]; // should report a warning at this line// b[i]=a[i+6]; // This line can be detected
}
}
Expected outcome: A warning
PMD should report a violation at line 6, but doesn't. This is a false-negative.
Running PMD through:[Maven]
The text was updated successfully, but these errors were encountered:
Affects PMD Version:6.42.0
Rule:AvoidArrayLoops
Please provide the rule name and a link to the rule documentation:
https://pmd.github.io/latest/pmd_rules_java_performance.html#avoidarrayloops
Description:
Hi, I found a false negative about the rule AvoidArrayLoops. Please read the following case. PMD should have reported a warning at line 6, but it doesn't. However, it can detect line 7. I think line 6 and line 7 are same. Hence, this is a false negative. Thanks for your consideration.
Code Sample demonstrating the issue:
Expected outcome: A warning
PMD should report a violation at line 6, but doesn't. This is a false-negative.
Running PMD through: [Maven]
The text was updated successfully, but these errors were encountered: