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 2019/11/17 11:40:36 UTC

svn commit: r1869937 - in /pdfbox/branches/2.0: debugger/src/main/java/org/apache/pdfbox/debugger/streampane/ debugger/src/main/java/org/apache/pdfbox/debugger/ui/ examples/src/main/java/org/apache/pdfbox/examples/printing/ pdfbox/src/main/java/org/apa...

Author: tilman
Date: Sun Nov 17 11:40:35 2019
New Revision: 1869937

URL: http://svn.apache.org/viewvc?rev=1869937&view=rev
Log:
PDFBOX-4071: SonarQube fix: remove exception that won't be thrown

Modified:
    pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/streampane/StreamPane.java
    pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/ui/PDFTreeModel.java
    pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/printing/Printing.java
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/JPEGFactory.java

Modified: pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/streampane/StreamPane.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/streampane/StreamPane.java?rev=1869937&r1=1869936&r2=1869937&view=diff
==============================================================================
--- pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/streampane/StreamPane.java (original)
+++ pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/streampane/StreamPane.java Sun Nov 17 11:40:35 2019
@@ -219,7 +219,7 @@ public class StreamPane implements Actio
         }
     }
 
-    private void requestImageShowing() throws IOException
+    private void requestImageShowing()
     {
         if (stream.isImage())
         {

Modified: pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/ui/PDFTreeModel.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/ui/PDFTreeModel.java?rev=1869937&r1=1869936&r2=1869937&view=diff
==============================================================================
--- pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/ui/PDFTreeModel.java (original)
+++ pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/ui/PDFTreeModel.java Sun Nov 17 11:40:35 2019
@@ -306,7 +306,7 @@ public class PDFTreeModel implements Tre
     @Override
     public boolean isLeaf(Object node)
     {
-        boolean isLeaf = !(node instanceof COSDictionary ||
+        return !(node instanceof COSDictionary ||
                  node instanceof COSArray ||
                  node instanceof COSDocument ||
                  node instanceof DocumentEntry ||
@@ -314,7 +314,6 @@ public class PDFTreeModel implements Tre
                  node instanceof COSObject ||
                  (node instanceof MapEntry && !isLeaf(((MapEntry)node).getValue()) ) ||
                  (node instanceof ArrayEntry && !isLeaf(((ArrayEntry)node).getValue()) ));
-        return isLeaf;
     }
 
     /** Removes a listener previously added with

Modified: pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/printing/Printing.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/printing/Printing.java?rev=1869937&r1=1869936&r2=1869937&view=diff
==============================================================================
--- pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/printing/Printing.java (original)
+++ pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/printing/Printing.java Sun Nov 17 11:40:35 2019
@@ -68,7 +68,7 @@ public final class Printing
     /**
      * Prints the document at its actual size. This is the recommended way to print.
      */
-    private static void print(PDDocument document) throws IOException, PrinterException
+    private static void print(PDDocument document) throws PrinterException
     {
         PrinterJob job = PrinterJob.getPrinterJob();
         job.setPageable(new PDFPageable(document));
@@ -78,8 +78,7 @@ public final class Printing
     /**
      * Prints using custom PrintRequestAttribute values.
      */
-    private static void printWithAttributes(PDDocument document)
-            throws IOException, PrinterException
+    private static void printWithAttributes(PDDocument document) throws PrinterException
     {
         PrinterJob job = PrinterJob.getPrinterJob();
         job.setPageable(new PDFPageable(document));
@@ -93,7 +92,7 @@ public final class Printing
     /**
      * Prints with a print preview dialog.
      */
-    private static void printWithDialog(PDDocument document) throws IOException, PrinterException
+    private static void printWithDialog(PDDocument document) throws PrinterException
     {
         PrinterJob job = PrinterJob.getPrinterJob();
         job.setPageable(new PDFPageable(document));
@@ -107,8 +106,7 @@ public final class Printing
     /**
      * Prints with a print preview dialog and custom PrintRequestAttribute values.
      */
-    private static void printWithDialogAndAttributes(PDDocument document)
-            throws IOException, PrinterException
+    private static void printWithDialogAndAttributes(PDDocument document) throws PrinterException
     {
         PrinterJob job = PrinterJob.getPrinterJob();
         job.setPageable(new PDFPageable(document));
@@ -143,8 +141,7 @@ public final class Printing
     /**
      * Prints using a custom page size and custom margins.
      */
-    private static void printWithPaper(PDDocument document)
-            throws IOException, PrinterException
+    private static void printWithPaper(PDDocument document) throws PrinterException
     {
         PrinterJob job = PrinterJob.getPrinterJob();
         job.setPageable(new PDFPageable(document));

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/JPEGFactory.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/JPEGFactory.java?rev=1869937&r1=1869936&r2=1869937&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/JPEGFactory.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/JPEGFactory.java Sun Nov 17 11:40:35 2019
@@ -304,7 +304,7 @@ public final class JPEGFactory
     }
     
     // returns the alpha channel of an image
-    private static BufferedImage getAlphaImage(BufferedImage image) throws IOException
+    private static BufferedImage getAlphaImage(BufferedImage image)
     {
         if (!image.getColorModel().hasAlpha())
         {