代码之家  ›  专栏  ›  技术社区  ›  joseph

当javadoc和@param之间没有空行时,如何使checkstyle失败

  •  1
  • joseph  · 技术社区  · 7 年前

    例如,我有下面的代码。我希望checkstyle抱怨,因为我的顶级javadoc注释和@clauses之间没有空行。

    /**
     * This line or the next line should fail checkstyle.
     * @param param is essential
     * @throws Exception is thrown when something bad happens
     */
    

    当javadoc更改为如下所示时,Checkstyle不应抱怨:

    /**
     * This line or the next line should no longer fail.
     * 
     * @param param is essential
     * @throws Exception is thrown when something bad happens
     */
    

    <module name="JavadocParagraph"/>
    

    enter image description here

    1 回复  |  直到 7 年前
        1
  •  2
  •   Mureinik    7 年前

    JavadocParagraph 检查应确保。只需将以下内容添加到checkstyle配置中:

    <module name="JavadocParagraph"/>