From 43232dae2e1a61cf341fb912e570e9fd2041e9d8 Mon Sep 17 00:00:00 2001 From: lsiepel Date: Sun, 19 Feb 2023 20:47:42 +0100 Subject: [PATCH] [smartmeter] Remove org.apache.common (#14436) Signed-off-by: lsiepel --- .../openhab/binding/smartmeter/internal/SmartMeterHandler.java | 3 +-- .../binding/smartmeter/internal/helper/SerialParameter.java | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/SmartMeterHandler.java b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/SmartMeterHandler.java index 1134310e850..2f9a5dec119 100644 --- a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/SmartMeterHandler.java +++ b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/SmartMeterHandler.java @@ -25,7 +25,6 @@ import java.util.function.Supplier; import javax.measure.Quantity; import javax.measure.Unit; -import org.apache.commons.lang3.StringUtils; import org.eclipse.jdt.annotation.DefaultLocation; import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jdt.annotation.NonNullByDefault; @@ -101,7 +100,7 @@ public class SmartMeterHandler extends BaseThingHandler { "Parameter 'port' is mandatory and must be configured"); } else { byte[] pullSequence = config.initMessage == null ? null - : HexUtils.hexToBytes(StringUtils.deleteWhitespace(config.initMessage)); + : HexUtils.hexToBytes(config.initMessage.replaceAll("\\s+", "")); int baudrate = config.baudrate == null ? Baudrate.AUTO.getBaudrate() : Baudrate.fromString(config.baudrate).getBaudrate(); this.conformity = config.conformity == null ? Conformity.NONE : Conformity.valueOf(config.conformity); diff --git a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/helper/SerialParameter.java b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/helper/SerialParameter.java index bc51e0fed94..23cbc214d56 100644 --- a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/helper/SerialParameter.java +++ b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/helper/SerialParameter.java @@ -12,7 +12,6 @@ */ package org.openhab.binding.smartmeter.internal.helper; -import org.apache.commons.lang3.StringUtils; import org.eclipse.jdt.annotation.NonNullByDefault; import org.openhab.core.io.transport.serial.SerialPort; @@ -66,7 +65,7 @@ public enum SerialParameter { */ public static SerialParameter fromString(String params) { try { - return valueOf("_" + StringUtils.upperCase(params)); + return valueOf("_" + params.toUpperCase()); } catch (IllegalArgumentException e) { return SerialParameter._8N1; }