Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.0.30, 3.0.1 PDFBox, 4.0.0
-
None
-
None
Description
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).