[java] ClassWithOnlyPrivateConstructorsShouldBeFinal can't detect inner class #2536
Labels
a:false-negative
PMD doesn't flag a problematic piece of code
Milestone
Affects PMD Version:
6.22.0
Rule:
ClassWithOnlyPrivateConstructorsShouldBeFinal
Description:
ClassWithOnlyPrivateConstructorsShouldBeFinal can't detect inner class with only private constructor
This rule is implemented through xpath search:
while the AST analyse result of inner class in code sample is:
AST chain to class
InputBits
is TypeDeclaration->ClassOrInterfaceDeclaration->ClassOrInterfaceBody->ClassOrInterfaceBodyDeclaration->ClassOrInterfaceDeclarationCode Sample demonstrating the issue:
Expected outcome:
false-negative
Running PMD through:
CLI
The text was updated successfully, but these errors were encountered: