Author: msahyoun
Date: Sun Mar 11 17:44:39 2018
New Revision: 1826447

URL: http://svn.apache.org/viewvc?rev=1826447&view=rev
Log:
PDFBOX-4071: use JDK7 try-with

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java

Modified: 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java
URL: 
http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java?rev=1826447&r1=1826446&r2=1826447&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java 
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java 
Sun Mar 11 17:44:39 2018
@@ -982,8 +982,7 @@ public class PDDocument implements Close
     public static PDDocument load(File file, String password, InputStream 
keyStore, String alias,
                                   MemoryUsageSetting memUsageSetting) throws 
IOException
     {
-        RandomAccessBufferedFileInputStream raFile = new 
RandomAccessBufferedFileInputStream(file);
-        try
+        try (RandomAccessBufferedFileInputStream raFile = new 
RandomAccessBufferedFileInputStream(file))
         {
             ScratchFile scratchFile = new ScratchFile(memUsageSetting);
             try
@@ -1000,7 +999,6 @@ public class PDDocument implements Close
         }
         catch (IOException ioe)
         {
-            IOUtils.closeQuietly(raFile);
             throw ioe;
         }
     }


Reply via email to