[
https://issues.apache.org/jira/browse/PDFBOX-4723?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17006443#comment-17006443
]
Tilman Hausherr commented on PDFBOX-4723:
-----------------------------------------
Oh, you're right on the first one, getLength() just gets the dictionary entry,
I thought it gets the actual stream length.
Because of that you would also be right on the second one, a COSStream would
have one entry more. Unless a "pure" dictionary has a length entry, not sure if
this is realistic:
{code:java}
COSDictionary d = new COSDictionary();
COSStream s = new COSStream();
d.setItem(COSName.BE, COSName.BE);
d.setInt(COSName.LENGTH, 0);
s.setItem(COSName.BE, COSName.BE);
System.out.println(d.equals(s));
System.out.println(s.equals(d));{code}
output:
true
false
> 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: 2.0.19, 3.0.0 PDFBox
>
>
> 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]