Got an exception - java.lang.RuntimeException: Unable to get class information for @throws tag 'XXXException'.

This message can be quite confusing. The cause of this message cannot be easily guessed from the error message CheckStyle gives.

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.

So you need to modify the ant scriptlet which runs your checkstyle (-when running checkstyle locally, during automatic screening there's nothing you can do about it..) to include all libraries in the run classpath:

<taskdef resource="checkstyletask.properties"
/>
 
<target name="checkstyle" depends="compile" >
<mkdir dir="${testlogdir}" />
<checkstyle failonviolation="false" config="../tc_checks.xml" >
<classpath>
<path refid="buildlibs" />
<pathelement location="${build_classdir}" />
</classpath>
<fileset dir="${javamain}" includes="**/*.java" />
<formatter type="plain" toFile="${testlogdir}/checkstyle.txt" />
</checkstyle>
</target>
 
<target name="checkstyle_tests" depends="compile_tests" >
<mkdir dir="${testlogdir}" />
<checkstyle failonviolation="false" config="../tc_test_checks.xml" >
<classpath>
<path refid="buildlibs" />
<pathelement location="${javatests}" />
</classpath>
<fileset dir="${javatests}/${packagedir}/" includes="**/*.java"
excludes="UnitTests.java, AllTests.java, stresstests/*, failuretests/*, accuracytests/*" />
<formatter type="plain" toFile="${testlogdir}/checkstyletest.txt" />
</checkstyle>
</target>



Note: the files tc_checks.xml and tc_test_checks.xml can be obtained here: http://www.topcoder.com/tc?module=Static&d1=dev&d2=support&d3=compDocumentation

For this message to not occur during automatic screening some admin needs to fix this thing on the TC server, but as this classpath is component-dependant (each component uses different libraries) and I assume that the checks performed during automatic screening use one generic script for all submissons of all components, this would be a bigger change on the TC automatic screening implementation (even more complicated: if the submitter added some 3rd-party libraries, that were not part of CS in its submission).

So in general add the code mentioned above in your local build.xml (ivern , perhaps you could add this to the dev dist jars as a convenience...) and add checkstyle to your ant classpath, then check locally and fix the things you want. Afterwards you dont't need to look at the checkstyle results during automatic screening(as they should be identical to the local check results ) and instead only need to check the results of the other automatic-screening-modules (like your name found in your submission).

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值