You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "lehmi (via GitHub)" <gi...@apache.org> on 2023/01/22 16:17:50 UTC

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

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


##########
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:
   I don't like the idea to introduce a new type just to avoid that people might follow the bad idea to pass an immutable map for a cache. IMHO if the do so, they have to deal with an exception.



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