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] New rule ConfusingArgumentToVarargsMethod #4971
[java] New rule ConfusingArgumentToVarargsMethod #4971
Conversation
The new errorprone rule catches more cases (it doesn't only care about array allocations).
Generated by 🚫 Danger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There seems to be a problem with the regression tester being confused, see pmd/pmd-regression-tester#124
I've now disabled that - maybe we see then some regression results.
If that works, I'm going to merge this later today.
Also thanks for cleanup up the existing code base!
Merge pull request #4971 from oowekyala:new-rule-UnnecessaryVarargsArrayCreation
Describe the PR
The new rule
ConfusingArgumentToVarargsMethod
is in errorprone and cares about the "confusing argument" part. This makes it so that:null
as the argument, which is also confusing. Note that this rule corresponds to a javac compiler warning (eg https://github.com/pmd/pmd/actions/runs/8764585900/job/24054740589#step:7:2865)This PR also fixes the violations of both rules in our codebase
Related issues
Ready?
./mvnw clean verify
passes (checked automatically by github actions)