pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1862668 - /pdfbox/branches/2.0/tools/src/main/java/org/apache/pdfbox/tools/DecompressObjectstreams.java
Date Sat, 06 Jul 2019 18:45:02 GMT
Author: tilman
Date: Sat Jul  6 18:45:02 2019
New Revision: 1862668

URL: http://svn.apache.org/viewvc?rev=1862668&view=rev
Log:
PDFBOX-4071: SonarQube fix

Modified:
    pdfbox/branches/2.0/tools/src/main/java/org/apache/pdfbox/tools/DecompressObjectstreams.java

Modified: pdfbox/branches/2.0/tools/src/main/java/org/apache/pdfbox/tools/DecompressObjectstreams.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/tools/src/main/java/org/apache/pdfbox/tools/DecompressObjectstreams.java?rev=1862668&r1=1862667&r2=1862668&view=diff
==============================================================================
--- pdfbox/branches/2.0/tools/src/main/java/org/apache/pdfbox/tools/DecompressObjectstreams.java
(original)
+++ pdfbox/branches/2.0/tools/src/main/java/org/apache/pdfbox/tools/DecompressObjectstreams.java
Sat Jul  6 18:45:02 2019
@@ -23,6 +23,7 @@ import org.apache.pdfbox.cos.COSStream;
 import org.apache.pdfbox.pdfparser.PDFObjectStreamParser;
 import org.apache.pdfbox.pdmodel.PDDocument;
 import org.apache.pdfbox.cos.COSObjectKey;
+import org.apache.pdfbox.io.IOUtils;
 
 /**
  * This program will just take all of the stream objects in a PDF and dereference
@@ -100,16 +101,7 @@ public final class DecompressObjectstrea
         }
         finally
         {
-            if(doc != null)
-            {
-                try
-                { 
-                    doc.close();
-                }
-                catch(Exception e)
-                {
-                }
-            }
+            IOUtils.closeQuietly(doc);
         }
     }
 



Mime
View raw message