1

I've written a class that has every line covered through JUnit/emma (its a fairly basic class).

Emma's eclipse output shows all lines in green (covered). However, emma's report (HTML) shows that I've missed 1 instruction. It highlights the class in yellow (public class X).

The missed instruction appears to be related to a "static initializer". I'm familiar with them, and this particular class has no

static {

}

block in it. It has no static methods at all. It does have 4 public static final ints. It also contains an enum.

The HTML output indicates:

class X$1
<static initializer>

as being the instruction (and method) that is not covered.

Where is this mystery instruction coming from? How can I test it?

I dont have any inner classes in this file, I can't even explain where the $1 is coming from.

Ryan Stewart
  • 126,015
  • 21
  • 180
  • 199
panther ts
  • 21
  • 2
  • As an experiment, you could refactor the enum into its own class to see if the message goes away. – Duncan Jones Feb 14 '13 at 07:56
  • This is from enum. See http://stackoverflow.com/questions/1834632/java-enum-and-additional-class-files – mvmn Oct 17 '13 at 19:54

0 Answers0