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