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 2020/12/08 16:38:00 UTC

[jira] [Commented] (PDFBOX-4723) Add equals() and hashCode() to COS objects

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

Andreas Lehmkühler commented on PDFBOX-4723:
--------------------------------------------

[~msahyoun] Shouldn't we remove equals() and hashCode() from COSStream for the very same reason? I've stumbled upon that in the context of PDFBOX-4952. org.apache.pdfbox.pdmodel.font.PDFontTest.testPDFBox3826() creates a pdf using the same font for 3 different configuration, which leads to 2 different instances of PDFontDescriptor with a COStream for "fontfile2" which have the same content but are not identical.

> Add equals() and hashCode() to COS objects
> ------------------------------------------
>
>                 Key: PDFBOX-4723
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4723
>             Project: PDFBox
>          Issue Type: Sub-task
>          Components: PDModel
>    Affects Versions: 2.0.18
>            Reporter: Maruan Sahyoun
>            Assignee: Maruan Sahyoun
>            Priority: Major
>             Fix For: 3.0.0 PDFBox
>
>         Attachments: bird_burst.heic.pdf, image-2020-09-02-13-52-21-370.png, image-2020-09-02-13-53-02-622.png, image-2020-09-02-13-54-31-630.png, screenshot-1.png
>
>
> In order to proper support removeAll/retainAll for COSArrayList we need to detect if entries are in fact duplicates of others. This currently fails as even though one might add the same instance of an annotation object multiple times to setAnnotations getting the annotations will have individual instances. See the discussion at PDFBOX-4669.
> In order to proper support removal we need to be able to detect equality where an object is equal if the underlying COSDictionary has the same entries.



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