// TODO: Build first a map, and then pass all annotations at once
Map annotationsToAdd = new HashMap();
while (mAnnotations.hasNext()) {
AnnotationFS annotationFS = mAnnotations.next();
annotationsToAdd.put(new EclipseAnnotationPeer(annotationFS), new Position(
annotationFS.getBegin(), annotationFS.getEnd() - annotationFS.getBegin()));
}
((IAnnotationModelExtension) annotationModel).replaceAnnotations(null, annotationsToAdd);
}