You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "valery (Jira)" <ji...@apache.org> on 2021/05/22 14:31:00 UTC

[jira] [Commented] (PDFBOX-4669) Ensure proper functionality of COSArrayList

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

valery commented on PDFBOX-4669:
--------------------------------

COSArrayList. When you add the first element, you refresh the parentDict field (set to "array"). When you clear the COSArrayList instance, you do the same (set to null).
I can't understand why you don't do the same for removeAll, remove, retainAll for the empty collection case (need to check "array.isEmpty ()")? Maybe it cannot be empty. I mean, without refreshing the parentDict field for these cases. What if only first item will be removed (need to refresh a value from parentDict)?
Second question is why should COSArray.removeAll method not work like COSArrayList.removeAll? I mean the first part of the COSArrayList.removeAll method where the items are removed from the COSArray. You are converting COSArray elements using the getObject method, why don't you use this code in COSArray.removeAll?

> Ensure proper functionality of COSArrayList
> -------------------------------------------
>
>                 Key: PDFBOX-4669
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4669
>             Project: PDFBox
>          Issue Type: Sub-task
>          Components: PDModel
>    Affects Versions: 2.0.17, 3.0.0 PDFBox
>            Reporter: Maruan Sahyoun
>            Assignee: Maruan Sahyoun
>            Priority: Major
>
> The current COSArrayList implementation has some glitches as pointed out at https://stackoverflow.com/questions/45812696/
> In addition when working with {{AnnotationFilter}} as the adding/update/removal is index based the wron index of the underlying {{COSArray}} is affected. 



--
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