From 48ea5bf055156f92d497a9a45bc05ac9d85b6f43 Mon Sep 17 00:00:00 2001 From: Tuukka Lehtonen Date: Mon, 31 Dec 2018 15:36:49 +0200 Subject: [PATCH] ImportPdfReader now implements Closeable gitlab #243 Change-Id: I1d422e6c4103a4836210d15648ad47785fbe3972 --- .../src/org/simantics/export/core/pdf/ImportPdfReader.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; -- 2.47.1