Author: tilman
Date: Thu Feb 5 20:41:01 2026
New Revision: 1931728
Log:
PDFBOX-5660: close input, as suggested by Valery Bokov; closes #414
Modified:
pdfbox/branches/3.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/graphics/image/CCITTFactoryTest.java
Modified:
pdfbox/branches/3.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/graphics/image/CCITTFactoryTest.java
==============================================================================
---
pdfbox/branches/3.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/graphics/image/CCITTFactoryTest.java
Thu Feb 5 18:45:03 2026 (r1931727)
+++
pdfbox/branches/3.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/graphics/image/CCITTFactoryTest.java
Thu Feb 5 20:41:01 2026 (r1931728)
@@ -239,9 +239,11 @@ class CCITTFactoryTest
String tiffG3Path =
"src/test/resources/org/apache/pdfbox/pdmodel/graphics/image/ccittg3.tif";
File copiedTiffFile = new File(TESTRESULTSDIR, "ccittg3.tif");
Files.copy(new File(tiffG3Path).toPath(), copiedTiffFile.toPath(),
StandardCopyOption.REPLACE_EXISTING);
- PDDocument document = new PDDocument();
- CCITTFactory.createFromFile(document, copiedTiffFile);
- assertTrue(copiedTiffFile.delete());
+ try (PDDocument document = new PDDocument())
+ {
+ CCITTFactory.createFromFile(document, copiedTiffFile);
+ assertTrue(copiedTiffFile.delete());
+ }
}
/**
@@ -255,9 +257,11 @@ class CCITTFactoryTest
String tiffG3Path =
"src/test/resources/org/apache/pdfbox/pdmodel/graphics/image/ccittg3.tif";
File copiedTiffFile = new File(TESTRESULTSDIR, "ccittg3n.tif");
Files.copy(new File(tiffG3Path).toPath(), copiedTiffFile.toPath(),
StandardCopyOption.REPLACE_EXISTING);
- PDDocument document = new PDDocument();
- CCITTFactory.createFromFile(document, copiedTiffFile, 0);
- assertTrue(copiedTiffFile.delete());
+ try (PDDocument document = new PDDocument())
+ {
+ CCITTFactory.createFromFile(document, copiedTiffFile, 0);
+ assertTrue(copiedTiffFile.delete());
+ }
}
/**