Maven checkstyle错误:'<T>'的@param标记

use*_*822 13 java generics javadoc checkstyle maven

我有以下通用类型的方法,但是当我运行maven checkstyle(maven-checkstyle-plugin,2.121)时,它会Expected @param tag for '<T>'在maven构建期间给出错误消息.我该如何克服这个?

/**
 * Read in specified type of object from request body.
 * @param request The HttpServletRequest
 * @param expected The expected type T
 * @return <T> specified type of object
 */
public <T extends Object> T getExpectedValue(
    final HttpServletRequest request, final Class<T> expected)
Run Code Online (Sandbox Code Playgroud)

我使用以下来关闭泛型param标签,但它没有用,我也有上面提到的java doc.

<module name="JavadocType">
    <property name="allowMissingParamTags" value="true"/>
</module>
Run Code Online (Sandbox Code Playgroud)

gui*_*ido 14

它告诉您没有为方法类型参数编写javadoc:

/**
 * ...
 * @param <T> This is the type parameter
 * @param ....
 */
 public <T extends Object> T getExpectedValue(
        final HttpServletRequest request, final Class<T> expected)
Run Code Online (Sandbox Code Playgroud)

生成的javadoc将在标题中包含以下部分:

Type Parameters: 
    T - This is the type parameter
Run Code Online (Sandbox Code Playgroud)