如何解析At子句应具有非空描述Checkstyle-Java

如何解析At子句应具有非空描述Checkstyle-Java,java,checkstyle,google-style-guide,Java,Checkstyle,Google Style Guide,我在EclipseLuna的checkstyle插件中使用google java风格。在我的java文档中看到这个错误,但似乎找不到解决方法。这是次要的,但它困扰着我 我的javadoc: /** * This is a description of something * * @throws Exception */ 错误在@throws行,错误: At-clause should have a non-empty description 通常,您应该编写 *

我在EclipseLuna的checkstyle插件中使用google java风格。在我的java文档中看到这个错误,但似乎找不到解决方法。这是次要的,但它困扰着我

我的javadoc:

/**
   * This is a description of something
   * 
   * @throws Exception
   */
错误在@throws行,错误:

At-clause should have a non-empty description

通常,您应该编写

 * @throws Exception when this exceptional condition happens
e、 g


…并大致解释了发生异常的原因。

这是文档中以“@”开头的每个参数的通用消息。 因此,对于每个参数,都需要添加一些描述

例如:

/**
     * Searches for top cars
     * @param carSearchRequest represents CarSearchRequest body
     * @param userId represents userid
     * @return CarsResponse
     * @throws Exception when userid is null
     */

为了解决这个问题,使我的构建不会因为checkstyle而失败,我制作了一个Eclipse,在“Javadoc”上下文中使用:

选择异常的名称,按Ctrl+Space,选择“throws”(我给模板的名称),您就有了一条Checkstyle法律注释:

* @throws IOException
*      When IOException occurs.
这是一个愚蠢的评论,但也是一个愚蠢的要求

${word_selection}
   *           When ${word_selection} occurs.
* @throws IOException
*      When IOException occurs.