In general when iterating using an "iterator" (where concurrent
modifications are not allowed), and you need to delete items from the
collection being iterated, the only viable choice is to do the entire scan
over the iterator and merely "collect information" (like put all the stuff
you want to delete in a separate list), and then make a second iteration
over your "stuff to delete" list, and do the deleting at that time. This
is, in general, the approach for deleting from a list you're currently
scanning.

Best regards,
Clay Ferguson
[email protected]


On Sun, Apr 3, 2016 at 10:29 AM, Unico Hommes (JIRA) <[email protected]>
wrote:

>
>     [
> https://issues.apache.org/jira/browse/JCR-3833?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15223358#comment-15223358
> ]
>
> Unico Hommes commented on JCR-3833:
> -----------------------------------
>
> [~takahito.kikuchi] One possible solution is to keep a {{counter}} and
> increase it every time {{null}} is returned from {{LRUCache#remove()}}.
> Then, at the same time, skip the newly created iterator to {{counter}}
> before continuing. WDYT?
>
> > Compatibility with Java 8
> > -------------------------
> >
> >                 Key: JCR-3833
> >                 URL: https://issues.apache.org/jira/browse/JCR-3833
> >             Project: Jackrabbit Content Repository
> >          Issue Type: Task
> >            Reporter: Unico Hommes
> >            Assignee: Unico Hommes
> >             Fix For: 2.9.1, 2.8.1
> >
> >
>
>
>
>
> --
> This message was sent by Atlassian JIRA
> (v6.3.4#6332)
>

Reply via email to