[ 
https://issues.apache.org/jira/browse/UIMA-6342?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Richard Eckart de Castilho resolved UIMA-6342.
----------------------------------------------
    Resolution: Fixed

> Moving iterator beyond bounds does not invalidate it
> ----------------------------------------------------
>
>                 Key: UIMA-6342
>                 URL: https://issues.apache.org/jira/browse/UIMA-6342
>             Project: UIMA
>          Issue Type: Bug
>          Components: UIMA
>            Reporter: Richard Eckart de Castilho
>            Assignee: Richard Eckart de Castilho
>            Priority: Major
>             Fix For: 3.2.0SDK
>
>
> {code}
>   @Test
>   public void thatSeekingIteratorToOutOfIndexPositionOnRightIsInvalid() 
> throws Exception {
>     TypeSystemDescription tsd = 
> getResourceSpecifierFactory().createTypeSystemDescription();
>     tsd.addType("test.Type1", "", CAS.TYPE_NAME_ANNOTATION);
>     tsd.addType("test.Type2", "", CAS.TYPE_NAME_ANNOTATION);
>     tsd.addType("test.Type3", "", CAS.TYPE_NAME_ANNOTATION);
>     
>     CAS cas = CasCreationUtils.createCas(tsd, null, null, null);
>     
>     Type type1 = cas.getTypeSystem().getType("test.Type1");
>     Type type2 = cas.getTypeSystem().getType("test.Type2");
>     Type type3 = cas.getTypeSystem().getType("test.Type3");
>     
>     AnnotationFS window, seekPoint;
>     addToIndexes(
>             window = cas.createAnnotation(type1, 0, 10),
>             cas.createAnnotation(type2, 5, 6),
>             seekPoint = cas.createAnnotation(type3, 8, 9),
>             cas.createAnnotation(type2, 15, 16));
>     
>     FSIterator<AnnotationFS> it = 
> cas.getAnnotationIndex(type2).select().coveredBy(window).fsIterator();
>     
>     it.moveTo(seekPoint);
>     // Iterator should be invalid at this point because the insertion points 
> is right of [5,6]
>     assertThat(it.isValid()).isFalse();
>   }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to