[
https://issues.apache.org/jira/browse/PDFBOX-4664?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16947916#comment-16947916
]
Maruan Sahyoun commented on PDFBOX-4664:
----------------------------------------
All of the issues can be fixed although we should keep them in mind. The
current code obviously has a number of flaws.
For 3.x I'm wondering if it might not be easier that if someone adds/removes
annotations (or other objects which might be using COSArrayList) instead of
magically updating the COS model it's clearer that one needs to set the pages
annotations afterwards. Currently we have a mix where sometimes it needs to be
explicitly set (e.g. fields) and where it's added (e.g. annotations).
> 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: [email protected]
For additional commands, e-mail: [email protected]