[
https://issues.apache.org/jira/browse/UIMA-4146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14240001#comment-14240001
]
Richard Eckart de Castilho commented on UIMA-4146:
--------------------------------------------------
You may be aware of the "select*(CAS, ...)" methods from the uimaFIT CasUtil
and JCasUtil classes. Are you planning to copy their approach over to the UIMA
core?
> Support Snapshot iterators for FSIndexes
> ----------------------------------------
>
> Key: UIMA-4146
> URL: https://issues.apache.org/jira/browse/UIMA-4146
> Project: UIMA
> Issue Type: New Feature
> Components: Core Java Framework
> Reporter: Marshall Schor
> Assignee: Marshall Schor
> Fix For: 2.7.0SDK
>
>
> Implementing "protectIndices" could have a consequence that some updated FSs
> could be removed from the indices by the framework, and addedback later. If
> the user code were iterating they might get unexpected
> ConcurrentModificationExceptions because of this.
> Extend the iterators to include "snapshot" iterators, that take a snapshot of
> the index contents at iterator creation time, and then use that to iterate
> over; this allows the iterator to avoid ConcurrentModificationExceptions.
> Do this in a manner to continue to support the "extended for" style of
> iterating, where you can write
> {code:java}
> for (MyAnnotation : fsIndexProducingSnapshotIterators) { ... }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)