您的位置:首页 > 其它

Checkstyle "Unable to get class information for @throws tag 'xxxException" 问题

2009-03-18 14:48 766 查看
这两天, 在运行checkstyle检查代码的时候, 老是出现"Unable to get class information for @throws tag 'xxxException"

看了半天, 找不出原因, java类中的import都是正确的, 编译什么也都没有问题.

上网搜索了一下, 找到一篇讨论,
http://forums.topcoder.com/?module=Thread&threadID=508195&start=0
The cause is that the class ConfigurationException, which is mentioned in BasicPDFBuilder is not in the run classpath of Checkstyle, so checkstyle cannot perform any checks on whether it is a checked exception or a runtime exception or other. So this is not really a warning about your code being bad, but a warning about checkstyle being unable to fully check whether the import and usage of the class ConfigurationException conforms to the coding styles configured.

看了一下, 原来是因为编译好的类没有在checkstyle的classpath中.

所以, 只要将编译好的class配置到在<checkstyle/>的classpath中就没有这个问题了.

另外, 还发现checkstyle的line length好像也有点问题, 明明没有超过120个字符, 却还是报错.

无奈, 我把Eclipse中java > code style > formatter中的Maximum line with改成了100, 然后format一下, 基本就没有问题了.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐