Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.2.1
-
None
Description
The following code illustrates the problem:
public void testUndefinedType() throws Exception {
//create jcas with no type system
JCas jcas = CasCreationUtils.createCas(new TypeSystemDescription_impl(), null, null).getJCas();
jcas.setDocumentText("This is a test.");
try
catch(CASRuntimeException e) {
}
//check that this does not leave JCAS in an inconsistent state
Iterator iter = jcas.getAnnotationIndex().iterator();
assertTrue(iter.hasNext());
Annotation annot = (Annotation)iter.next();
}
Running this gives a ClassCastException trying to cast the result of iter.next() to an Annotation