#1281 UnusedPrivateMethod incorrectly flagged for methods nested private classes

PMD-5.2.2
closed
None
PMD
3-Major
Bug
2014-12-03
2014-11-14
szetheli
No

Rule:
UnusedPrivateMethod

Rule set:
Unused Code

The following code incorrectly produces an UnusedPrivateMethod warning. This is with auxclasspath containing the built artifacts for NestedClassPrivateMethods (and I and B)

public class NestedClassPrivateMethods {
public void doPublic() {
doPrivate(new B());
}

private void doPrivate(I i) { // incorrectly UnusedPrivateMethod 
}

private interface I {
    void visit();
}

private class B implements I {
    public void visit()
    {
    }
}

}

Related

Issues: #1286
Issues: #1287

Discussion

  • Andreas Dangel

    Andreas Dangel - 2014-11-15
    • status: open --> closed
    • assigned_to: Andreas Dangel
    • Milestone: New Tickets --> PMD-Next
     
  • Andreas Dangel

    Andreas Dangel - 2014-11-15

    Will be fixed with the next version.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks