From: Tuukka Lehtonen Date: Mon, 31 Dec 2018 13:36:49 +0000 (+0200) Subject: ImportPdfReader now implements Closeable X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=7b37d2208d9f0e89efadba9b9817d62726bd9511;p=simantics%2Fplatform.git ImportPdfReader now implements Closeable gitlab #243 Change-Id: I1d422e6c4103a4836210d15648ad47785fbe3972 (cherry picked from commit 48ea5bf055156f92d497a9a45bc05ac9d85b6f43) --- diff --git a/bundles/org.simantics.export.core/src/org/simantics/export/core/pdf/ImportPdfReader.java b/bundles/org.simantics.export.core/src/org/simantics/export/core/pdf/ImportPdfReader.java index 21c0c8e4d..51bec046b 100644 --- a/bundles/org.simantics.export.core/src/org/simantics/export/core/pdf/ImportPdfReader.java +++ b/bundles/org.simantics.export.core/src/org/simantics/export/core/pdf/ImportPdfReader.java @@ -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;