Thursday, July 31, 2008

[cobertura-instrument] WARN visitEnd, No line number information found for class

Have you seen this warning earlier? I have used cobertura for many years now, and while working on this demo was frequently seeing this warning. The cobertura-report was displaying N/A for Line and Branch coverage.

When I switched back to my Mac, things were working smoothly, when I moved back to my Windows Vista laptop on which I was preparing for the demo, I was getting the same warning and no coverage results.



I tried to run the target from ant with verbose on and it displayed the warning message saying:

[cobertura-instrument] WARN visitEnd, No line number information found for class com.stelligent.demo.CustomerInfo.
Perhaps you need to compile with debug=true?
[cobertura-instrument] WARN visitEnd, No line number information found for class com.stelligent.demo.StringToDate.
Perhaps you need to compile with debug=true?


Looked at the javac task at the Ant website, added a few more options and it worked like a charm. I have no clue why this happens on Vista, is it because I am using Java 6 here and Mc uses Java 5? Go figure.

The changes I added was as such for the javac task:

debug="true" debuglevel="vars,lines,source"


7 comments:

  1. Great post! That just saved me some time. Cheers. http://www.thejavajar.com

    ReplyDelete
  2. This is a great hint. Thanks a lot.

    ReplyDelete
  3. Ran into the same issue. Resolved the same. Thank you for the post.

    ReplyDelete
  4. thanks. However i still see lineCoverage/Branch coverage as 0% only ..though i have run the tests!!!

    ReplyDelete
  5. Excellent. Right on spot. Thanks.

    ReplyDelete
  6. thanks it helped me

    ReplyDelete
  7. great help! thanks!

    ReplyDelete