pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1843319 - in /pdfbox/branches/2.0: pdfbox/src/main/java/org/apache/pdfbox/multipdf/Overlay.java tools/src/main/java/org/apache/pdfbox/tools/OverlayPDF.java
Date Tue, 09 Oct 2018 18:12:56 GMT
Author: tilman
Date: Tue Oct  9 18:12:56 2018
New Revision: 1843319

URL: http://svn.apache.org/viewvc?rev=1843319&view=rev
Log:
PDFBOX-4335: add @Override, close overlay object in utility (SonarQube complaints)

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Overlay.java
    pdfbox/branches/2.0/tools/src/main/java/org/apache/pdfbox/tools/OverlayPDF.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Overlay.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Overlay.java?rev=1843319&r1=1843318&r2=1843319&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Overlay.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Overlay.java Tue Oct
 9 18:12:56 2018
@@ -129,6 +129,7 @@ public class Overlay implements Closeabl
      * 
      * @throws IOException if something went wrong
      */
+    @Override
     public void close() throws IOException
     {
         if (defaultOverlay != null)

Modified: pdfbox/branches/2.0/tools/src/main/java/org/apache/pdfbox/tools/OverlayPDF.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/tools/src/main/java/org/apache/pdfbox/tools/OverlayPDF.java?rev=1843319&r1=1843318&r2=1843319&view=diff
==============================================================================
--- pdfbox/branches/2.0/tools/src/main/java/org/apache/pdfbox/tools/OverlayPDF.java (original)
+++ pdfbox/branches/2.0/tools/src/main/java/org/apache/pdfbox/tools/OverlayPDF.java Tue Oct
 9 18:12:56 2018
@@ -137,20 +137,23 @@ public final class OverlayPDF
             usage();
         }
         
-        try 
+        try
         {
             PDDocument result = overlayer.overlay(specificPageOverlayFile);
             result.save(outputFilename);
             result.close();
-            // close the input files AFTER saving the resulting file as some 
-            // streams are shared among the input and the output files
-            overlayer.close();
         } 
         catch (IOException e) 
         {
             LOG.error("Overlay failed: " + e.getMessage(), e);
             throw e;
         }
+        finally
+        {
+            // close the input files AFTER saving the resulting file as some 
+            // streams are shared among the input and the output files
+            overlayer.close();
+        }
     }
 
     private static void usage()



Mime
View raw message