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

Christian Appl commented on PDFBOX-4723:
----------------------------------------

I want to put it this way: I know, that this is how equals() works. That is why 
I will compare said objects using == as suggested previously. I dislike, that 
this also influences the way Lists are handling the objects - which also adds 
the necessity to provide a solution for this on my end. (To provide either a 
collection or method, that implements a "contains()" checking for identity 
rather than equality of the compared objects.)
To know all this, I have to be aware of this being the case. When I am aware of 
this, it is easy to provide a solution - however... it would be nice, if PDFbox 
provided the solution itself.
The behaviour of PDFbox changed - libraries change - I have to adapt. But still 
- the behaviour of lists (containing COSStreams) changed and is no longer 
behaving as it used to - which causes bugs and unexpected results on my end. I 
analyzed the issue, I found the cause of my problem and I implemented 
workarrounds.

The question I'm posing: Is this worth it and is it working?

> Add equals() and hashCode() to PDAnnotation and 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, 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to