如何修复Javadoc注释有解析错误,详细信息:在解析JAVADOC_TAG时,输入' *'没有可行的替代方案[NonEmptyAtClauseDescription]


/**
* This method is used for ABC.
* @return
* @throw IOException when this exceptional condition occurs
*/

[Error]:line:4- Javadoc注释在第0列有解析错误。细节:在解析JAVADOC_TAG时,在输入' *'处没有可行的替代(NonEmptyAtClauseDescription)

知道为什么我在Javadoc的@throw行中得到这个错误吗?如何解决这个问题?

如上所述,在返回标记中添加描述或完全删除它以解决错误。

$ cat TestClass.java
public class TestClass {
/**
* This method is used for ABC.
* @return desc
* @throw IOException when this exceptional condition occurs
*/
int method() throws IOException  {
return 0; 
}
}
$ cat TestConfig.xml
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
<property name="charset" value="UTF-8"/>
<module name="TreeWalker">
<module name="NonEmptyAtclauseDescriptionCheck" />
</module>
</module>
$ java -jar checkstyle-9.0.1-all.jar -c TestConfig.xml TestClass.java
Starting audit...
Audit done.

最新更新