【问题标题】:How to remove specific Cobertura warning?如何删除特定的 Cobertura 警告?
【发布时间】:2011-07-02 13:22:23
【问题描述】:

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

请指教。

【问题讨论】:

    标签: ant warnings cobertura


    【解决方案1】:

    设置 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?
    

    【讨论】:

    • 我也看到这个警告只针对内部类。有谁知道如何解决这个问题?
    【解决方案2】:

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

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

    【讨论】:

      猜你喜欢
      • 2021-09-24
      • 2021-07-21
      • 1970-01-01
      • 2019-08-04
      • 2019-01-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-10-27
      相关资源
      最近更新 更多