Author: tilman
Date: Fri Jul 24 09:24:52 2026
New Revision: 1936542
Log:
PDFBOX-5660: avoid NPE, fix javadoc
Modified:
pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/graphics/image/CCITTFactoryTest.java
Modified:
pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/graphics/image/CCITTFactoryTest.java
==============================================================================
---
pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/graphics/image/CCITTFactoryTest.java
Fri Jul 24 09:22:54 2026 (r1936541)
+++
pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/graphics/image/CCITTFactoryTest.java
Fri Jul 24 09:24:52 2026 (r1936542)
@@ -65,6 +65,8 @@ public class CCITTFactoryTest extends Te
/**
* Tests CCITTFactory#createFromRandomAccess(PDDocument document,
* RandomAccess reader) with a single page TIFF
+ *
+ * @throws IOException
*/
public void testCreateFromRandomAccessSingle() throws IOException
{
@@ -104,6 +106,8 @@ public class CCITTFactoryTest extends Te
/**
* Tests CCITTFactory#createFromRandomAccess(PDDocument document,
* RandomAccess reader) with a multi page TIFF
+ *
+ * @throws IOException
*/
public void testCreateFromRandomAccessMulti() throws IOException
{
@@ -214,6 +218,8 @@ public class CCITTFactoryTest extends Te
/**
* Tests that CCITTFactory#createFromFile(PDDocument document, File file)
doesn't lock the
* source file
+ *
+ * @throws IOException
*/
public void testCreateFromFileLock() throws IOException
{
@@ -230,6 +236,8 @@ public class CCITTFactoryTest extends Te
/**
* Tests that CCITTFactory#createFromFile(PDDocument document, File file,
int number) doesn't
* lock the source file
+ *
+ * @throws IOException
*/
public void testCreateFromFileNumberLock() throws IOException
{
@@ -255,14 +263,16 @@ public class CCITTFactoryTest extends Te
}
finally
{
- is.close();
- os.close();
+ IOUtils.closeQuietly(is);
+ IOUtils.closeQuietly(os);
}
}
/**
* Tests that byte/short tag values are read correctly (ignoring possible
garbage in remaining
* bytes).
+ *
+ * @throws IOException
*/
public void testByteShortPaddedWithGarbage() throws IOException
{
@@ -314,6 +324,8 @@ public class CCITTFactoryTest extends Te
* value. The previous implementation returned a (possibly negative) int,
which was then
* sign-extended when widened to long, corrupting IFD offsets/counts whose
high bit is set
* (e.g. 0x80000000 and above).
+ *
+ * @throws IOException
*/
public void testReadLongIsUnsigned() throws IOException
{