You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
ClassWithOnlyPrivateConstructorsShouldBeFinal can't detect inner class with only private constructor
This rule is implemented through xpath search:
AST chain to class InputBits is TypeDeclaration->ClassOrInterfaceDeclaration->ClassOrInterfaceBody->ClassOrInterfaceBodyDeclaration->ClassOrInterfaceDeclaration
Code Sample demonstrating the issue:
public class Main209 {
......
private static class InputBits {
private InputBits(int number) {
}
......
Expected outcome:
false-negative
Running PMD through:
CLI
The text was updated successfully, but these errors were encountered:
oowekyala
changed the title
[java]ClassWithOnlyPrivateConstructorsShouldBeFinal can't detect inner class with only private constructor
[java]ClassWithOnlyPrivateConstructorsShouldBeFinal can't detect inner class
Jul 12, 2021
oowekyala
changed the title
[java]ClassWithOnlyPrivateConstructorsShouldBeFinal can't detect inner class
[java] ClassWithOnlyPrivateConstructorsShouldBeFinal can't detect inner class
Jul 12, 2021
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: