You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Andreas Lehmkühler (Jira)" <ji...@apache.org> on 2019/10/06 20:06:00 UTC

[jira] [Comment Edited] (PDFBOX-4664) Iterator.remove() does not work in COSArrayList

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

Andreas Lehmkühler edited comment on PDFBOX-4664 at 10/6/19 8:05 PM:
---------------------------------------------------------------------

IMHO we have two options here:
- use an unmodifiable Iterator/ListIterator
- implement our own supporting modifications as well

WDYT?


was (Author: lehmi):
IMHO we have to options here:
- use an unmodifiable Iterator/ListIterator
- implement our own supporting modifications as well

WDYT?

> Iterator.remove() does not work in COSArrayList
> -----------------------------------------------
>
>                 Key: PDFBOX-4664
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4664
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 2.0.17
>            Reporter: Zhichao Yang
>            Assignee: Andreas Lehmkühler
>            Priority: Minor
>
> {code:java}
> for (Iterator itr = pdfPage.getAnnotations().iterator(); itr.hasNext(); ) {
>                     itr.remove();
>  }
> {code}
> This is not working on annotations list because cosArrayList.iterator() is cosArrayList.actual.iterator(), but when convert to a COSArray it uses cosArrayList.array, which is not affected by iterator.remove(). A iterator to sync the actual and the array would be nice.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org