How to remove specific Cobertura warning?

China☆狼群 提交于 2019-12-10 10:46:09

问题


When i am running my ANT build script, Cobertura is complaining with the following warning. With that, i am wondering what it means really and how can i turn it off.

[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 sample below:

<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>

Please advise.


回答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">



回答2:


Setting debuglevel appears to not work for anonymous inner classes (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?


来源:https://stackoverflow.com/questions/5087948/how-to-remove-specific-cobertura-warning

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!