Uploaded image for project: 'UIMA'
  1. UIMA
  2. UIMA-6342

Moving iterator beyond bounds does not invalidate it

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.2.0SDK
    • UIMA
    • None

    Description

        @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();
        }
      

      Attachments

        Issue Links

          Activity

            People

              rec Richard Eckart de Castilho
              rec Richard Eckart de Castilho
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: