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

Unico Hommes commented on JCR-3833:
-----------------------------------

[~takahito.kikuchi] Because the iterator is indeed ordered, all the keys of the 
items that could not be deleted will be at the beginning of the iterator and 
you will skip them because you counted them all. However, I agree with Clay 
Ferguson on the dev list that it would be more robust to first collect all the 
keys to delete in a separate list and then use the keys in the separate list to 
remove the items from the cache. That way there is no concurrent modification 
of the list you are iterating over. My only concern was the added overhead in 
terms of memory and processing that comes with creating a separate list but 
that is probably quite acceptable.

> 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