Richard Eckart de Castilho created UIMA-5829:
------------------------------------------------
Summary: `between` throws an exception for zero-width annotations
Key: UIMA-5829
URL: https://issues.apache.org/jira/browse/UIMA-5829
Project: UIMA
Issue Type: Bug
Components: UIMA
Affects Versions: 3.0.0SDK
Reporter: Richard Eckart de Castilho
SelectFS throws an exception in the following case. Why not return an empty
list?
{code}
Token t1 = new Token(jCas, 45, 57);
t1.addToIndexes();
Token t2 = new Token(jCas, 52, 52);
t2.addToIndexes();
new Sentence(jCas, 52, 52).addToIndexes();
// uimaFIT: selectBetween(jCas, Sentence.class, t1, t2);
List<Sentence> stem1 = jCas.select(Sentence.class).between(t1, t2).asList();
assertTrue(stem1.isEmpty());
{code}
{code}
java.lang.IllegalArgumentException: End value must be >= Begin value
at
org.apache.uima.cas.impl.SelectFSs_impl.makePosAnnot(SelectFSs_impl.java:855)
at
org.apache.uima.cas.impl.SelectFSs_impl.between(SelectFSs_impl.java:435)
at
org.apache.uima.cas.impl.SelectFSs_impl.between(SelectFSs_impl.java:97)
...
{code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)