[jira] [Updated] (PDFBOX-5723) COSName caches already cached hashCode

2023-12-03 Thread Jira


 [ 
https://issues.apache.org/jira/browse/PDFBOX-5723?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andreas Lehmkühler updated PDFBOX-5723:
---
Fix Version/s: 2.0.31
   3.0.2 PDFBox
   4.0.0

> COSName caches already cached hashCode
> --
>
> Key: PDFBOX-5723
> URL: https://issues.apache.org/jira/browse/PDFBOX-5723
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.30, 3.0.1 PDFBox, 4.0.0
>Reporter: Axel Howind
>Assignee: Andreas Lehmkühler
>Priority: Minor
> Fix For: 2.0.31, 3.0.2 PDFBox, 4.0.0
>
> Attachments: Remove_hashCode()_field_from_COSName.patch
>
>
> COSName stores a name (String) and a hash code (int), both are final. The 
> constructor calculates the hashCode as `hashCode = name.hashCode()`. Since 
> the String class itself also caches the hashCode (it is calculated at first 
> access), this is unnecessary and on most JVM implementations wastes 8 bytes 
> of memory per COSName instance (4 for the integer and another 4 for padding). 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Updated] (PDFBOX-5723) COSName caches already cached hashCode

2023-12-03 Thread Jira


 [ 
https://issues.apache.org/jira/browse/PDFBOX-5723?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andreas Lehmkühler updated PDFBOX-5723:
---
Affects Version/s: 3.0.1 PDFBox
   2.0.30

> COSName caches already cached hashCode
> --
>
> Key: PDFBOX-5723
> URL: https://issues.apache.org/jira/browse/PDFBOX-5723
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.30, 3.0.1 PDFBox, 4.0.0
>Reporter: Axel Howind
>Assignee: Andreas Lehmkühler
>Priority: Minor
> Attachments: Remove_hashCode()_field_from_COSName.patch
>
>
> COSName stores a name (String) and a hash code (int), both are final. The 
> constructor calculates the hashCode as `hashCode = name.hashCode()`. Since 
> the String class itself also caches the hashCode (it is calculated at first 
> access), this is unnecessary and on most JVM implementations wastes 8 bytes 
> of memory per COSName instance (4 for the integer and another 4 for padding). 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Updated] (PDFBOX-5723) COSName caches already cached hashCode

2023-12-02 Thread Axel Howind (Jira)


 [ 
https://issues.apache.org/jira/browse/PDFBOX-5723?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Axel Howind updated PDFBOX-5723:

Attachment: Remove_hashCode()_field_from_COSName.patch

> COSName caches already cached hashCode
> --
>
> Key: PDFBOX-5723
> URL: https://issues.apache.org/jira/browse/PDFBOX-5723
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 4.0.0
>Reporter: Axel Howind
>Priority: Minor
> Attachments: Remove_hashCode()_field_from_COSName.patch
>
>
> COSName stores a name (String) and a hash code (int), both are final. The 
> constructor calculates the hashCode as `hashCode = name.hashCode()`. Since 
> the String class itself also caches the hashCode (it is calculated at first 
> access), this is unnecessary and on most JVM implementations wastes 8 bytes 
> of memory per COSName instance (4 for the integer and another 4 for padding). 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org