pdfbox-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Maruan Sahyoun (Jira)" <j...@apache.org>
Subject [jira] [Comment Edited] (PDFBOX-4664) Iterator.remove() does not work in COSArrayList
Date Wed, 09 Oct 2019 19:15:00 GMT

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

Maruan Sahyoun edited comment on PDFBOX-4664 at 10/9/19 7:14 PM:
-----------------------------------------------------------------

Thanks for the hint - good to keep that in mind. I'd start thinking about some unit tests
first to ensure that the current implementation is fixed. On top of that we have to implement
our own Iterator and ListIterator. I do that one 2.x first and not on trunk. For trunk I think
we shall do the same but use the opportunity to move some of the methods around. i.e. the
static methods which are used to create a COSArray are better suited either in COSArray or
a utility class. 

[~lehmi] are you fine if I take that?


was (Author: msahyoun):
Thanks for the hint - good to keep that in mind. I'd start thinking about some unit tests
first to ensure that the current implementation is fixed. On top of that we have to implement
our own Iterator and ListIterator. I do that one 2.x first and not on trunk. For trunk I think
we shall do the same but use the opportunity to move some of the methods around. i.e. the
static methods which are used to create a COSArray are better suited either in COSArray or
a utility class. 

> 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


Mime
View raw message