[
https://issues.apache.org/jira/browse/PDFBOX-4664?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16947393#comment-16947393
]
Maruan Sahyoun edited comment on PDFBOX-4664 at 10/9/19 6:45 AM:
-----------------------------------------------------------------
Yes, and potentially implement {{List}} in {{COSArray}}. We can do it for trunk
and maybe for 2.0. COSArray already has many of the List methods. Only issue is
that it will change some of the methods having a {{void}} to actually return
something. IMHO this can be done even in 2.0 as this will not change any code.
I'm not sure if we should do the COSArray change as it exposes some
implementation details but OTOH it already has List methods so I would go for
it.
was (Author: msahyoun):
Yes, and potentially implement {{List}} in {{COSArray}}. We can do it for trunk
and maybe for 2.0. COSArray already has many of the List methods. Only issue is
that it will change some of the methods having a {{void}} to actually return
something. IMHO this can be done even in 2.0 as this will not change any code.
> 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]