From 593dbc162a5569998696d7bd7951e54ff7e72fab Mon Sep 17 00:00:00 2001 From: Laurent Garnier Date: Fri, 22 May 2020 12:51:40 +0200 Subject: [PATCH] [serialbutton] Removed dependency on 'org.apache.commons.io.IOUtils' Relative to #7722 Signed-off-by: Laurent Garnier --- .../internal/handler/SerialButtonHandler.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bundles/org.openhab.binding.serialbutton/src/main/java/org/openhab/binding/serialbutton/internal/handler/SerialButtonHandler.java b/bundles/org.openhab.binding.serialbutton/src/main/java/org/openhab/binding/serialbutton/internal/handler/SerialButtonHandler.java index 25999161ec9e7..84616bd6b544f 100644 --- a/bundles/org.openhab.binding.serialbutton/src/main/java/org/openhab/binding/serialbutton/internal/handler/SerialButtonHandler.java +++ b/bundles/org.openhab.binding.serialbutton/src/main/java/org/openhab/binding/serialbutton/internal/handler/SerialButtonHandler.java @@ -16,7 +16,6 @@ import java.io.InputStream; import java.util.TooManyListenersException; -import org.apache.commons.io.IOUtils; import org.eclipse.jdt.annotation.NonNull; import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.CommonTriggerEvents; @@ -93,10 +92,15 @@ public void initialize() { @Override public void dispose() { + if (inputStream != null) { + try { + inputStream.close(); + } catch (IOException e) { + } + } if (serialPort != null) { serialPort.close(); } - IOUtils.closeQuietly(inputStream); } @Override