]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
ImportPdfReader now implements Closeable 89/2589/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Mon, 31 Dec 2018 13:36:49 +0000 (15:36 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Mon, 31 Dec 2018 13:36:49 +0000 (15:36 +0200)
gitlab #243

Change-Id: I1d422e6c4103a4836210d15648ad47785fbe3972

bundles/org.simantics.export.core/src/org/simantics/export/core/pdf/ImportPdfReader.java

index 21c0c8e4d913be597f2782cb61b0458f385442a1..51bec046bbdb07eb0657939de38ab258ad2295ef 100644 (file)
@@ -1,5 +1,6 @@
 package org.simantics.export.core.pdf;
 
+import java.io.Closeable;
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -13,7 +14,7 @@ import com.lowagie.text.pdf.PdfName;
 import com.lowagie.text.pdf.PdfReader;
 import com.lowagie.text.pdf.PdfString;
 
-public class ImportPdfReader {
+public class ImportPdfReader implements Closeable {
 
        /** File if opened from file */
        public File file;
@@ -68,7 +69,7 @@ public class ImportPdfReader {
                return result;
        }
        
-       public void close() {
+       public synchronized void close() {
                if ( reader!=null ) {
                        reader.close();
                        reader = null;