Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.2.0uimaFIT
-
None
Description
The returned object of JCasUtil.selectSingleRelative() should match the generic-type of its first argument.
However, when the last argument is 0, it returns an object whose class is identical to the second argument's class.
for (Annotation aa : cas.getAnnotationIndex(AA.type)) { Object ab = JCasUtil.selectSingleRelative(AB.class, aa, 0); System.out.println(ab.getClass().getName()); }
The output ought to be "AB", however it is "AA".
(When the last argument is 0, I thought it would find an annotation which begins exactly where the annotation of the second argument begins. However, it returns a wrong object).
Perhaps, if last-argument 0 is prohibited, an exception should be thrown (and documented).
Thanks.