如上所述,向返回标签添加描述或将其完全删除以解决错误。
$ 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.