Checkstyle 未检测到 @throws 标签

joh*_* cs 5 java javadoc checkstyle

Checkstyle 不断给我这个错误:

RemoteException 的预期 @throws 标记

这是我的 javadoc 注释和第一行方法:

   /**
     * Inits the filter
     *
     * @throws RemoteException if there is an issue
     */

    public void init() throws RemoteException {
Run Code Online (Sandbox Code Playgroud)

thi*_*lad 6

如果您尚未添加异常的描述,请尝试添加。这对我有用!


Rus*_*pez 6

真的希望这对某人有帮助:

/*
* @throws SomeExceptionPresentOnImports             some text
* @throws com.myorg.SomeExceptionPresentOnImports1  some text
*/
Run Code Online (Sandbox Code Playgroud)

两者均报告为错误

但如果你删除完全限定的名称,它不会抱怨。

/*
* @throws SomeExceptionPresentOnImports   some text
* @throws SomeExceptionPresentOnImports1  some text
*/
Run Code Online (Sandbox Code Playgroud)


小智 0

我有同样的问题。我最终修改了我的 checkstyle 配置文件:

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