Annotation antn = AnnotationRegistry.get(name);
if (antn != null) {
if (antn instanceof TextAnnotation) {
textAnnotations.add((TextAnnotation) antn);
textAnnotationsNames.add(((TextAnnotation) antn).getName()); // ensure we use canonical name
<BUG>} else
paragraphAnnotations.add(antn);
}  else{</BUG>
throw new SEditorException("Invalid annotation name");
}

Annotation antn = AnnotationRegistry.get(name);
if (antn != null) {
if (antn instanceof TextAnnotation) {
textAnnotations.add((TextAnnotation) antn);
textAnnotationsNames.add(((TextAnnotation) antn).getName()); // ensure we use canonical name
} else if (antn instanceof ParagraphAnnotation) {
paragraphAnnotations.add((ParagraphAnnotation) antn);
