From 0e630fc5b313b541b790e3256862fc282fe61050 Mon Sep 17 00:00:00 2001 From: lsiepel Date: Mon, 16 Oct 2023 22:59:29 +0200 Subject: [PATCH] [exec] Remove org.apache.common (#14443) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Leo Siepel Signed-off-by: Jørgen Austvik --- .../openhab/binding/exec/internal/handler/ExecHandler.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bundles/org.openhab.binding.exec/src/main/java/org/openhab/binding/exec/internal/handler/ExecHandler.java b/bundles/org.openhab.binding.exec/src/main/java/org/openhab/binding/exec/internal/handler/ExecHandler.java index cf9402d0de23a..d978ba99cac30 100644 --- a/bundles/org.openhab.binding.exec/src/main/java/org/openhab/binding/exec/internal/handler/ExecHandler.java +++ b/bundles/org.openhab.binding.exec/src/main/java/org/openhab/binding/exec/internal/handler/ExecHandler.java @@ -23,13 +23,13 @@ import java.util.Calendar; import java.util.Date; import java.util.IllegalFormatException; +import java.util.Objects; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; -import org.apache.commons.lang3.StringUtils; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.openhab.binding.exec.internal.ExecWhitelistWatchService; @@ -46,6 +46,7 @@ import org.openhab.core.transform.TransformationService; import org.openhab.core.types.Command; import org.openhab.core.types.RefreshType; +import org.openhab.core.util.StringUtils; import org.osgi.framework.BundleContext; import org.osgi.framework.FrameworkUtil; import org.slf4j.Logger; @@ -289,7 +290,7 @@ public void execute() { outputBuilder.append(errorBuilder.toString()); - String transformedResponse = StringUtils.chomp(outputBuilder.toString()); + String transformedResponse = Objects.requireNonNull(StringUtils.chomp(outputBuilder.toString())); String transformation = (String) getConfig().get(TRANSFORM); if (transformation != null && transformation.length() > 0) {