You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by "Marshall Schor (JIRA)" <de...@uima.apache.org> on 2015/06/27 22:17:04 UTC

[jira] [Commented] (UIMA-4487) Position lost on FSIterator copy

    [ https://issues.apache.org/jira/browse/UIMA-4487?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14604339#comment-14604339 ] 

Marshall Schor commented on UIMA-4487:
--------------------------------------

I was able to reproduce this, and see there are several problems.  I've got to investigate a bit more.

> Position lost on FSIterator copy
> --------------------------------
>
>                 Key: UIMA-4487
>                 URL: https://issues.apache.org/jira/browse/UIMA-4487
>             Project: UIMA
>          Issue Type: Bug
>          Components: Core Java Framework
>            Reporter: Richard Eckart de Castilho
>             Fix For: 2.8.0SDK
>
>
> Apparently, in some cases, a FSIterator becomes invalid/looses its position after a copy(). Unfortunately, I haven't been able to quickly create a plain UIMA test case (I tried reproducing the effect in GetAllIndexedTest, but couldn't.
> So the following snipped is works (fails) when pasted into the uimaFIT CasUtilTest after upgrading uimaFIT to 2.8.0 RC 1:
> {noformat}
>   @Test
>   public void lala() throws Exception {
>     String text = "Rot wood cheeses dew?";
>     tokenBuilder.buildTokens(jCas, text);
>     CAS cas = jCas.getCas();
>     // Option 1: remove the ".copy()"
>     FSIterator<FeatureStructure> fses = cas.getIndexRepository()
>             .getAllIndexedFS(cas.getTypeSystem().getTopType()).copy();
>     // Option 2: explicitly moveToFirst 
>     // fses.moveToFirst();
>     
>     int i = 0;
>     while (fses.hasNext()) {
>       fses.next();
>       i++;
>     }
>     
>     assertEquals(6, i);
>   }
> {noformat}
> Maybe you have some idea or can highlight another UIMA core test case where this could be conveniently tried out. (Unfortunately, setting up a test CAS in plain UIMA is a bit painful/verbose)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)