Checkstyle 抱怨枚举值没有附加的 javadoc 注释。但至少在我的许多枚举中,由于值本身通常是不言自明的,因此添加 javadoc 似乎只是降低了可读性并带来了不必要的混乱。考虑以下示例:
/**
* Example enum to illustrate the problem. Each value of this
* enum represents a day of the week.
*/
public enum DaysOfWeekClean {
SUNDAY,
MONDAY,
TUESDAY,
WEDNESDAY,
THURSDAY,
FRIDAY,
SATURDAY;
}
Run Code Online (Sandbox Code Playgroud)
/**
* Example enum to illustrate the problem. Each value of this
* enum represents a day of the week, with comments added to each
* distinct value to make the point.
*/
public enum DaysOfWeekCluttered {
/**
* The day …
Run Code Online (Sandbox Code Playgroud)