From 439eaae17f3825730c9d5d9f7bdd66767d2a369a Mon Sep 17 00:00:00 2001 From: "Jan N. Klug" Date: Sat, 22 May 2021 18:27:36 +0200 Subject: [PATCH 1/2] improve channel parameter processing Signed-off-by: Jan N. Klug --- .../org/smarthomej/binding/tr064/internal/util/Util.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bundles/org.smarthomej.binding.tr064/src/main/java/org/smarthomej/binding/tr064/internal/util/Util.java b/bundles/org.smarthomej.binding.tr064/src/main/java/org/smarthomej/binding/tr064/internal/util/Util.java index 736b129745..774f042944 100644 --- a/bundles/org.smarthomej.binding.tr064/src/main/java/org/smarthomej/binding/tr064/internal/util/Util.java +++ b/bundles/org.smarthomej.binding.tr064/src/main/java/org/smarthomej/binding/tr064/internal/util/Util.java @@ -295,9 +295,12 @@ private static Set getAndCheckParameters(String channelId, ActionType ac String parameterPattern = parameter.getPattern(); if (parameterPattern != null) { parameters.removeIf(param -> { - if (!param.matches(parameterPattern)) { - LOGGER.warn("Removing {} while processing {}, does not match pattern {}, check config.", param, - channelId, parameterPattern); + if (param.trim().isEmpty()) { + LOGGER.debug("Removing empty parameter while processing '{}'.", channelId); + return true; + } else if (!param.matches(parameterPattern)) { + LOGGER.warn("Removing '{}' while processing '{}', does not match pattern '{}', check config.", + param, channelId, parameterPattern); return true; } else { return false; From 933fba69c7c9c0f4ae25e30deefc93003445ab2b Mon Sep 17 00:00:00 2001 From: "Jan N. Klug" Date: Sun, 23 May 2021 12:01:58 +0200 Subject: [PATCH 2/2] address review comments Signed-off-by: Jan N. Klug --- .../java/org/smarthomej/binding/tr064/internal/util/Util.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.smarthomej.binding.tr064/src/main/java/org/smarthomej/binding/tr064/internal/util/Util.java b/bundles/org.smarthomej.binding.tr064/src/main/java/org/smarthomej/binding/tr064/internal/util/Util.java index 774f042944..8fc989694e 100644 --- a/bundles/org.smarthomej.binding.tr064/src/main/java/org/smarthomej/binding/tr064/internal/util/Util.java +++ b/bundles/org.smarthomej.binding.tr064/src/main/java/org/smarthomej/binding/tr064/internal/util/Util.java @@ -295,7 +295,7 @@ private static Set getAndCheckParameters(String channelId, ActionType ac String parameterPattern = parameter.getPattern(); if (parameterPattern != null) { parameters.removeIf(param -> { - if (param.trim().isEmpty()) { + if (param.isBlank()) { LOGGER.debug("Removing empty parameter while processing '{}'.", channelId); return true; } else if (!param.matches(parameterPattern)) {