-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Closed
Description
Take a simple class with a private
enum:
public class MyClass {
private enum PrivateEnum {
CONSTANT
}
}
When run with a simple checkstyle.xml
:
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
<module name="TreeWalker">
<module name="JavadocVariable">
<property name="accessModifiers" value="public"/>
</module>
</module>
</module>
[ERROR] MyClass.java:3:9: Missing a Javadoc comment. [JavadocVariable]
is thrown.
While investigating, the change in #16049 identifies any enum constant as being implicitly public (correct), but doesn't check if the enum itself is accessible (which it isn't, because private
).
Specifically, while upgrading checkstyle from 10.21.4
to 10.22.0
many such pre-existing private enums were now being flagged as violations.
emreyigit