Author: tilman
Date: Wed Mar 25 09:44:27 2026
New Revision: 1932534

Log:
PDFBOX-5660: sonar fix

Modified:
   
pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/rendering/TestPDFToImage.java
   
pdfbox/branches/2.0/tools/src/test/java/org/apache/pdfbox/tools/imageio/TestImageIOUtils.java

Modified: 
pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/rendering/TestPDFToImage.java
==============================================================================
--- 
pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/rendering/TestPDFToImage.java
    Wed Mar 25 09:44:19 2026        (r1932533)
+++ 
pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/rendering/TestPDFToImage.java
    Wed Mar 25 09:44:27 2026        (r1932534)
@@ -158,10 +158,8 @@ public class TestPDFToImage
      * @return If the images are different, the function returns a diff image. 
If the images are
      * identical, the function returns null. If the size is different, a black 
border on the bottom
      * at the right is created.
-     *
-     * @throws IOException
      */
-    private BufferedImage diffImages(BufferedImage bim1, BufferedImage bim2) 
throws IOException
+    private BufferedImage diffImages(BufferedImage bim1, BufferedImage bim2)
     {
         int minWidth = Math.min(bim1.getWidth(), bim2.getWidth());
         int minHeight = Math.min(bim1.getHeight(), bim2.getHeight());

Modified: 
pdfbox/branches/2.0/tools/src/test/java/org/apache/pdfbox/tools/imageio/TestImageIOUtils.java
==============================================================================
--- 
pdfbox/branches/2.0/tools/src/test/java/org/apache/pdfbox/tools/imageio/TestImageIOUtils.java
       Wed Mar 25 09:44:19 2026        (r1932533)
+++ 
pdfbox/branches/2.0/tools/src/test/java/org/apache/pdfbox/tools/imageio/TestImageIOUtils.java
       Wed Mar 25 09:44:27 2026        (r1932534)
@@ -23,7 +23,6 @@ import java.io.ByteArrayOutputStream;
 import java.io.DataInputStream;
 import java.io.File;
 import java.io.FileInputStream;
-import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.FilenameFilter;
 import java.io.IOException;
@@ -226,8 +225,7 @@ public class TestImageIOUtils extends Te
         checkBufferedImageSize(filename, image, newImage);
     }
 
-    private void checkBufferedImageSize(String filename,
-            BufferedImage image, BufferedImage newImage) throws IOException
+    private void checkBufferedImageSize(String filename, BufferedImage image, 
BufferedImage newImage)
     {
         assertEquals("File '" + filename + "' has different height after 
read", image.getHeight(), newImage.getHeight());
         assertEquals("File '" + filename + "' has different width after read", 
image.getWidth(), newImage.getWidth());
@@ -365,12 +363,12 @@ public class TestImageIOUtils extends Te
      * @throws IOException if something goes wrong
      */
     private void checkBmpResolution(String filename, int expectedResolution)
-            throws FileNotFoundException, IOException
+            throws IOException
     {
         // BMP format explained here:
         // 
http://www.javaworld.com/article/2077561/learn-java/java-tip-60--saving-bitmap-files-in-java.html
         // we skip 38 bytes and then read two 4 byte-integers and reverse the 
bytes
-        DataInputStream dis = new DataInputStream(new FileInputStream(new 
File(filename)));
+        DataInputStream dis = new DataInputStream(new 
FileInputStream(filename));
         int skipped = dis.skipBytes(38);
         assertEquals("Can't skip 38 bytes in image file " + filename, 38, 
skipped);
         int pixelsPerMeter = Integer.reverseBytes(dis.readInt());

Reply via email to