final IRegion reg = doc.getLineInformation(lr.getLineNum() - 1);
final int length = reg.getLength();
final int offset = reg.getOffset();
final Position pos = new Position(offset, length);
Annotation annotation;
if (lr.called()) {
annotation = CoverageAnnotationFactory
.create(CoverageTypes.FULL_COVERAGE);
} else {
annotation = CoverageAnnotationFactory.create(CoverageTypes.NO_COVERAGE);
}
final Annotation lastAnn = coverage.getAnnotation(editor.getTitle(), lr);
log.info(lastAnn);
if (lastAnn == null) {
annMod.addAnnotation(annotation, pos);
coverage.addAnnotation(editor.getTitle(), lr, annotation);
} else if (annMod.getPosition(lastAnn) == null) {
annMod.addAnnotation(lastAnn, pos);
} else if (lastAnn.getType().equals(CoverageTypes.NO_COVERAGE)
&& annotation.getType().equals(CoverageTypes.FULL_COVERAGE)) {
annMod.removeAnnotation(lastAnn);
annMod.addAnnotation(annotation, pos);
coverage.addAnnotation(editor.getTitle(), lr, annotation);