You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by GitBox <gi...@apache.org> on 2023/01/19 17:33:38 UTC

[GitHub] [pdfbox] knazarenkov commented on a diff in pull request #151: PDResource font cache improvement

knazarenkov commented on code in PR #151:
URL: https://github.com/apache/pdfbox/pull/151#discussion_r1081602283


##########
pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDResources.java:
##########
@@ -95,6 +96,24 @@ public PDResources(COSDictionary resourceDictionary, ResourceCache resourceCache
         }
         resources = resourceDictionary;
         cache = resourceCache;
+        directFontCache = new HashMap<COSName,SoftReference<PDFont>>();
+    }
+
+    /**
+     * Constructor for reading.
+     *
+     * @param resourceDictionary The cos dictionary for this resource.
+     * @param resourceCache The document's resource cache, may be null.
+     */

Review Comment:
   While adding javadoc I realised that mutability of cache cannot be deduced from method signature by reader - someone could try to use immutable map as parameter, so new type is introduced that is mutable by design - PDFontCache.
   Javadoc added also



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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