有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java需要帮助解决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) 个答案

  1. # 1 楼答案

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

    clover setup instrumentationLevel=“method”

  2. # 2 楼答案

    是的,您可以从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