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

标签 java javadoc checkstyle

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

/**
 * 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
 */

我尝试使用 @Mureinik 的建议,它并没有提示我在第一段和 @-clauses 之间缺少空行。我验证了 Eclipse 已识别出我在下面的屏幕截图中启用了 JavadocParagraph。

<module name="JavadocParagraph"/>

enter image description here

最佳答案

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

<module name="JavadocParagraph"/>

关于java - 当 javadoc 和 @param 之间没有空行时,如何使 checkstyle 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53125176/

相关文章:

java - hibernate @DynamicUpdate

java - 在 Android 中设置按钮颜色

java - 如何记录声明多个变量的单行?

java - 如何从类中检索已弃用方法的列表

java - Eclipse Checkstyle - 无法解析配置流

gradle - 在项目中运行自定义 checkstyle 检查

java - 将图像放入包中

java - SQLite 查询不适用于连接字符串

Javadoc 格式化超链接

java - Checkstyle中的 "variable access definition in wrong order"是什么意思?