You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Maruan Sahyoun (Jira)" <ji...@apache.org> on 2020/10/28 19:08:00 UTC

[jira] [Commented] (PDFBOX-2685) COS 'primitive' types are mutable

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

Maruan Sahyoun commented on PDFBOX-2685:
----------------------------------------

[~lehmi] is that still an issue? Think the changes done resolved it and the other discussion we had at that time would be a larger change which I don't see us doing shortly

> COS 'primitive' types are mutable
> ---------------------------------
>
>                 Key: PDFBOX-2685
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2685
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 1.8.8, 1.8.9, 2.0.0
>            Reporter: Tilman Hausherr
>            Assignee: Maruan Sahyoun
>            Priority: Critical
>             Fix For: 3.0.0 PDFBox
>
>
> From [~torakiki]:
> They are cached and they are mutable so this:
> {code}
>         COSInteger cosint = COSInteger.get(10);
>         cosint.setValue(50);
>         //lets move to a totally unrelated part of my software
>         System.out.println(COSInteger.get(10));
> {code}
> prints COSInteger(50) so basically I ask for a 10 and get a 50, isn't it weird (and error prone)? ... or the way around, I call cosint.setValue(50) at some point in the software and that makes it a 50 everywhere I used COSInteger.get(10).
> That's of course also true for the other mutable attributes setDirect and setNeedToBeUpdate.



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