The AnnotationFactory provides a shortcut alternative to creating an annotation and adding it to the indexes:
Internally, AnnotationFactory uses reflection on JCas classes to achieve that and if there is a problem while reflectively creating the annotation, it throws an UIMAException. It is very unlikely that a problem would occur. It could happen if security restrictions are in place on certain JCas wrapper classes. Yet, the UIMAException is not a RuntimeException, so it must be caught by client code.
AnnotationFactory could use the CAS interface instead of reflection to avoid the exception. We can be sure that any annotation created through the CAS interface can safely be cast to a JCas wrapper type, because the JCas has already been initialized when this method is calls (it receives a JCas as argument).