小编ber*_*tag的帖子

如何抑制枚举常量/值上缺少 javadoc checkstyle 警告?

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)

java checkstyle

4
推荐指数
1
解决办法
9248
查看次数

标签 统计

checkstyle ×1

java ×1