需要帮助解决Clover问题

时间:2010-07-20 19:17:52

标签: java eclipse shell ant clover

如果问题太模糊,请原谅我。我不是三叶草专家,但我需要解决这个问题。 Clover似乎与特定类有问题,如下面的跟踪所示。我需要完全从三部分中排除这个类,因为类不是必需的。这甚至是三叶草问题还是只是一个java问题?再次感谢,对不起,如果这只是微不足道的。

enter code here   [javac] [apt] warning: Annotation types without processors:  [java.lang.SuppressWarnings]
  [apt] 1 warning
   [apt] Ignoring compiler attribute for the APT task, as it is fixed
[javac] Compiling 268 source files to  /home/retail_website/build/.src/Platform/AlibrisBiz/build/classes
[clover] Clover Version 2.6.0, built on September 09 2009 (build-771)
[clover] Loaded from: /home/retail_website/build/clover/clover.jar
[clover] Clover: Commercial License registered to Alibris.
[clover] Updating existing database at '/home/retail_website/build/clover.database/clover.db'.
[clover] Processing files at 1.5 source level.
[clover] Clover all over. Instrumented 268 files (27 packages).
[clover] Elapsed time = 7.155 secs. (37.456 files/sec, 9,859.259 /tmp/clover51982.tmp/com/maxmind/geoip/regionName.java:4: code too large for try statement
[javac] static public String regionNameByCode(String country_code,String region_code) {try{__CLR2_6_09so9sogbuuz0jf.R.inc(12696);
[javac]                                                                                   ^
[javac] /tmp/clover51982.tmp/com/maxmind/geoip/regionName.java:4: code too large
[javac] static public String regionNameByCode(String country_code,String region_code) {try{__CLR2_6_09so9sogbuuz0jf.R.inc(12696);
[javac]                      ^
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 2 errors

2 个答案:

答案 0 :(得分:0)

是的,您可以从ant任务中排除包级别的类。

http://confluence.atlassian.com/display/CLOVER/6.+Ant+Task+Reference

实施例

<clover-setup enabled="${enable}">
     <files>
       <exclude name="**/cenqua/clover/**/*.java"/>
     </files>
</clover-setup>

http://confluence.atlassian.com/display/CLOVER/clover-setup

了解详情

如果您正在使用Maven运行,请按照此http://confluence.atlassian.com/display/CLOVER/Clover-for-Maven+2+User%27s+Guide#Clover-for-Maven2User%27sGuide-ControllingwhichSourceFilesareInstrumented

进行操作

答案 1 :(得分:0)

Java将方法字节码大小限制为64kb,正如其他贡献者所解释的那样。 一种解决方案是排除某人提到的文件。 另一种解决方案是将仪器级别更改为“方法”。默认情况下,它设置为语句。以下更改必须包含在clover-setup标记中。

clover-setup instrumentationLevel =“method”