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] UnnecessaryBoxing, but explicit conversion is necessary #4903
Comments
That's because your code is doing the conversion chain Although the rule is still definitely wrong because the conversion is not unnecessary in this case. |
I see. Using |
Affects PMD Version: 7.0.0
Rule: UnnecessaryBoxing
Description: PMD reports "Unnecessary explicit conversion from Integer to Long" violation, but removing the explicit conversion will break compilation.
Code Sample demonstrating the issue:
Expected outcome:
PMD reports a violation at line 16 (see comment), but that's wrong. That's a false positive.
Running PMD through: Gradle
The text was updated successfully, but these errors were encountered: