views:

177

answers:

1

Hi,

I have a class that starts with:

public class GeneralID implements WritableComparable<GeneralID>{
...
}

And another that is:

public class LineValuesMapper<KI, VI, KO, VO> extends Mapper<LongWritable, Text, Text, IntWritable>{
...
}

All methods in these classes are covered. But not their header. The header of both classes gets painted as yellow with EclEmma.

The covered instructions for these classes are:

Element Coverage    Covered Instructions    Total Instructions
LineValuesMapper.java   97.3 %  145 149
GeneralID.java  99.3 %  566 570

Is there anything I can do to fully cover the class header?

+2  A: 

For classes that extend generic superclasses or implement generic interfaces, the compiler may add synthetic bridge methods. See the results of looking at the bytecode of a similar case.

Maybe in your classes, these bridge methods are not called. OTOH, I just read that Emma has an option for ignoring synthetic or bridge methods which is enabled by default.

Christian Semrau
I was wracking my brain for this answer earlier. Good catch. Emma may have this option, but I don't remember whether EclEmma uses it when it's driving Emma from within Eclipse.
jasonmp85
Along these lines, Enums apparently also have some issues with Emma (http://padcom13.blogspot.com/2009/12/code-coverage-and-enum-types.html). Maybe Fork can find a similar workaround?
jasonmp85
Where do I disable it? One thing that I've noticed both of the classes I mentioned above use an enum that I have defined elsewhere.I am trying to test the enum, but no luck.
Fork