From 111312abc7b7757badbd3ce2887f2977c58a1057 Mon Sep 17 00:00:00 2001 From: clinique Date: Sat, 4 Jan 2025 09:44:18 +0100 Subject: [PATCH] Apply spotless Signed-off-by: clinique --- .../openhab/binding/gce/internal/action/Ipx800Actions.java | 6 ++---- .../binding/gce/internal/handler/Ipx800DeviceConnector.java | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/bundles/org.openhab.binding.gce/src/main/java/org/openhab/binding/gce/internal/action/Ipx800Actions.java b/bundles/org.openhab.binding.gce/src/main/java/org/openhab/binding/gce/internal/action/Ipx800Actions.java index 9ae9a97d803..268b3ce1fdf 100644 --- a/bundles/org.openhab.binding.gce/src/main/java/org/openhab/binding/gce/internal/action/Ipx800Actions.java +++ b/bundles/org.openhab.binding.gce/src/main/java/org/openhab/binding/gce/internal/action/Ipx800Actions.java @@ -58,8 +58,7 @@ public class Ipx800Actions implements ThingActions { public void resetCounter( @ActionInput(name = "counter", label = "Counter", required = true, description = "Id of the counter", type = "java.lang.Integer") Integer counter) { logger.debug("IPX800 action 'resetCounter' called"); - Ipx800v3Handler theHandler = this.handler; - if (theHandler != null) { + if (handler instanceof Ipx800v3Handler theHandler) { theHandler.resetCounter(counter); } else { logger.warn("Method call resetCounter failed because IPX800 action service ThingHandler is null!"); @@ -70,8 +69,7 @@ public class Ipx800Actions implements ThingActions { public void reset( @ActionInput(name = "placeholder", label = "Placeholder", required = false, description = "This parameter is not used", type = "java.lang.Integer") @Nullable Integer placeholder) { logger.debug("IPX800 action 'reset' called"); - Ipx800v3Handler theHandler = this.handler; - if (theHandler != null) { + if (handler instanceof Ipx800v3Handler theHandler) { theHandler.reset(); } else { logger.warn("Method call reset failed because IPX800 action service ThingHandler is null!"); diff --git a/bundles/org.openhab.binding.gce/src/main/java/org/openhab/binding/gce/internal/handler/Ipx800DeviceConnector.java b/bundles/org.openhab.binding.gce/src/main/java/org/openhab/binding/gce/internal/handler/Ipx800DeviceConnector.java index fc1c373eea0..e3779f2e031 100644 --- a/bundles/org.openhab.binding.gce/src/main/java/org/openhab/binding/gce/internal/handler/Ipx800DeviceConnector.java +++ b/bundles/org.openhab.binding.gce/src/main/java/org/openhab/binding/gce/internal/handler/Ipx800DeviceConnector.java @@ -146,7 +146,6 @@ public class Ipx800DeviceConnector extends Thread { logger.warn("Exception closing socket: {}", e.getMessage()); } } - } public StatusFile readStatusFile() throws SAXException, IOException {