Skip to content

Commit

Permalink
[nibeheatpump] Removed dependency on 'org.apache.commons.io.IOUtils'
Browse files Browse the repository at this point in the history
Relative to openhab#7722

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
  • Loading branch information
lolodomo committed May 22, 2020
1 parent efc84f1 commit 1a47134
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.util.List;
import java.util.TooManyListenersException;

import org.apache.commons.io.IOUtils;
import org.eclipse.smarthome.core.util.HexUtils;
import org.eclipse.smarthome.io.transport.serial.PortInUseException;
import org.eclipse.smarthome.io.transport.serial.SerialPort;
Expand Down Expand Up @@ -116,11 +115,17 @@ public void disconnect() {
}
if (out != null) {
logger.debug("Close serial out stream");
IOUtils.closeQuietly(out);
try {
out.close();
} catch (IOException e) {
}
}
if (in != null) {
logger.debug("Close serial in stream");
IOUtils.closeQuietly(in);
try {
in.close();
} catch (IOException e) {
}
}
if (serialPort != null) {
logger.debug("Close serial port");
Expand Down Expand Up @@ -163,7 +168,10 @@ public class SerialReader extends Thread implements SerialPortEventListener {
public void interrupt() {
interrupted = true;
super.interrupt();
IOUtils.closeQuietly(in);
try {
in.close();
} catch (IOException e) {
}
}

@Override
Expand Down

0 comments on commit 1a47134

Please sign in to comment.