2

当我运行我的 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>

请指教。

4

2 回答 2

6

设置调试级别似乎不适用于匿名内部类(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?
于 2012-04-04T13:17:42.753 回答
1

As suggested here in the cobertura mailing-list, perhaps you can try adding the debug options and see if that helps.

<javac debug="true" debuglevel="vars,lines,source">
于 2011-02-23T07:44:35.000 回答