Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1.6k
Closed
Description
Affects PMD Version: pmd:3.19.0:check
Rule:UnusedPrivateMethod
Description:
Calling a private method that accept one parameter of type Number (superclass of autoboxing-type Integer)
Code Sample demonstrating the issue:
// ...foo(2);}privatevoidfoo(Numberbar) {System.out.println(bar);}
Expected outcome:
PMD reports a violation at line 124, but that's wrong. That's a false positive.
Running PMD through:Maven
Workaround:
Cast the parameter to Number will work:
// ...foo((Number)2);}privatevoidfoo(Numberbar) {System.out.println(bar);}