Skip to content

Commit

Permalink
[serialbutton] Removed dependency on 'org.apache.commons.io.IOUtils' (o…
Browse files Browse the repository at this point in the history
…penhab#7739)

Relative to openhab#7722

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
  • Loading branch information
lolodomo authored and J-N-K committed Jul 14, 2020
1 parent c77ff5f commit 31ea584
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -93,10 +92,21 @@ public void initialize() {

@Override
public void dispose() {
if (serialPort != null) {
serialPort.removeEventListener();
}
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException e) {
logger.debug("Error while closing the input stream: {}", e.getMessage());
}
}
if (serialPort != null) {
serialPort.close();
}
IOUtils.closeQuietly(inputStream);
inputStream = null;
serialPort = null;
}

@Override
Expand Down

0 comments on commit 31ea584

Please sign in to comment.