You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2026/07/11 21:03:48 UTC

svn commit: r1936062 - pdfbox/branches/3.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font

Author: tilman
Date: Sat Jul 11 21:03:48 2026
New Revision: 1936062

Log:
PDFBOX-5660: close input as suggested by Valery Bokov; closes #479

Modified:
   pdfbox/branches/3.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestFontEmbedding.java

Modified: pdfbox/branches/3.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestFontEmbedding.java
==============================================================================
--- pdfbox/branches/3.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestFontEmbedding.java	Sat Jul 11 20:59:24 2026	(r1936061)
+++ pdfbox/branches/3.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestFontEmbedding.java	Sat Jul 11 21:03:48 2026	(r1936062)
@@ -461,8 +461,8 @@ class TestFontEmbedding
         // what the old reverse mapping always picked; highCp used to be mis-extracted as lowCp.
         int lowCp = -1;
         int highCp = -1;
-        try (TrueTypeFont ttf = new TTFParser().parse(
-                new RandomAccessReadBuffer(getNotoCjk())))
+        try (InputStream is = getNotoCjk();
+             TrueTypeFont ttf = new TTFParser().parse(new RandomAccessReadBuffer(is)))
         {
             CmapLookup cmap = ttf.getUnicodeCmapLookup();
             int numGlyphs = ttf.getMaximumProfile().getNumGlyphs();
@@ -522,7 +522,8 @@ class TestFontEmbedding
 
         // precondition: both code points map to the same glyph and the radical is the lower one,
         // i.e. the entry the old reverse mapping wrongly picked for both
-        try (TrueTypeFont ttf = new TTFParser().parse(new RandomAccessReadBuffer(getNotoCjk())))
+        try (InputStream is = getNotoCjk();
+             TrueTypeFont ttf = new TTFParser().parse(new RandomAccessReadBuffer(is)))
         {
             CmapLookup cmap = ttf.getUnicodeCmapLookup();
             int gid = cmap.getGlyphId(ideograph);