Skip to content
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] UnusedPrivateMethod false positive with generics #2890

Closed
Adam- opened this issue Nov 1, 2020 · 1 comment · Fixed by #3113
Closed

[java] UnusedPrivateMethod false positive with generics #2890

Adam- opened this issue Nov 1, 2020 · 1 comment · Fixed by #3113
Labels
a:false-positive PMD flags a piece of code that is not problematic
Projects
Milestone

Comments

@Adam-
Copy link

Adam- commented Nov 1, 2020

Affects PMD Version: 6.29.0

Rule: UnusedPrivateMethod

Please provide the rule name and a link to the rule documentation:
https://pmd.github.io/latest/pmd_rules_java_bestpractices.html#unusedprivatemethod

Description: See link to code below. The method is clearly being used a few lines above it (L807/808). If I had to guess probably something with the generics is throwing it off, since PMD has ran over the rest of the codebase okay.

Code Sample demonstrating the issue:

https://github.com/runelite/runelite/blob/7ceb3c9e020aa8316ddc5809a2d409d5d2efb697/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java#L811

Expected outcome:

PMD should not report sortedInsert as unused.

Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other] maven

@Adam- Adam- added the a:bug PMD crashes or fails to analyse a file. label Nov 1, 2020
@oowekyala oowekyala added this to the 7.0.0 milestone Nov 10, 2020
oowekyala added a commit to oowekyala/pmd that referenced this issue Nov 10, 2020
@adangel adangel added a:false-positive PMD flags a piece of code that is not problematic and removed a:bug PMD crashes or fails to analyse a file. labels Nov 23, 2020
@adangel adangel changed the title [java] UnusedPrivateMethod false positive [java] UnusedPrivateMethod false positive with generics Nov 23, 2020
@oowekyala oowekyala linked a pull request Feb 19, 2021 that will close this issue
4 tasks
@oowekyala oowekyala added this to Done in PMD 7 Apr 3, 2021
@adangel adangel mentioned this issue Jan 23, 2023
55 tasks
@adangel
Copy link
Member

adangel commented Apr 22, 2023

This has been fixed with PMD 7.0.0-rc1.

@adangel adangel closed this as completed Apr 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:false-positive PMD flags a piece of code that is not problematic
Projects
No open projects
PMD 7
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants