New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[java] ReplaceVectorWithList false-positive (neither Vector
nor List
usage)
#4852
Comments
Vector
nor List
usage)
Thanks for reporting this issue. I can only reproduce the problem, if I call PMD without compiling the project first - that means, without providing a correct The auxclasspath is usually determined automatically by build tools like maven or gradle. How do you call PMD exactly? I'll keep this issue open, to analyze the problem further. Because I don't understand atm, why we would figure out, that "E" would be of type "java.util.Vector". Ideally we would just not detect any problems, if the auxclasspath is wrong (that means, I would expect false negatives rather than false positives). |
For this issue, I was indeed doing |
A resync of our project around PMD7 migration led me to check the default CI command: Is it possible using I tried locally with
while
|
@blacelle sorry for the long delay, I'm circling back on this…
That's not entirely true… since Java 20, So if CI and local are using different Java versions, these differences are to be expected.
I wouldn't think so, but @adangel is probably better suited to respond… However, I would recommend first updating the plugin to version 3.22.0 which natively supports PMD 7, and using PMD 7.1.0. |
This follows some feedback in #4816
Affects PMD Version: 7.0.0-rc4
Rule: ReplaceVectorWithList
Description:
The 3 sets of classes generate false-positive.
Code Sample demonstrating the issue:
Expected outcome:
PMD reports a violation at line ..., but that's wrong. That's a false positive.
Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]
The text was updated successfully, but these errors were encountered: