如何删除特定的Cobertura警告?

时间:2011-02-23 07:07:39

标签: ant warnings cobertura

当我运行我的ANT构建脚本时,Cobertura抱怨以下警告。有了它,我想知道它究竟意味着什么,我怎么能把它关掉。

[cobertura-instrument] WARN visitEnd, No line number information found for class com.x.y.z.A. Perhaps you need to compile with debug=true?

以下ANT示例:

<target name="instrument" depends="init,compile" >
    <delete file="cobertura.ser" />
    <delete dir="${instrumented}" />
    <cobertura-instrument todir="${instrumented}">
        <ignore regex="org.apache.log4j.*" />
        <fileset dir="${build}" > 
            <include name="**/*.class" />
            <exclude name="**/Test*.class" />
        </fileset>
    </cobertura-instrument>
</target>

请告知。

2 个答案:

答案 0 :(得分:6)

设置debuglevel似乎不适用于匿名内部类(Cobertura 1.9.4.1)?

[cobertura-instrument] WARN   visitEnd, No line number information found for class com.test.MyClass$1.  Perhaps you need to compile with debug=true?

答案 1 :(得分:1)

正如cobertura邮件列表中建议的here,也许您可​​以尝试添加调试选项,看看是否有帮助。

<javac debug="true" debuglevel="vars,lines,source">