From 07b8fbe26b4d785637605d2011a44ecb18a3e1dc Mon Sep 17 00:00:00 2001 From: lsiepel Date: Sun, 19 Feb 2023 21:55:46 +0100 Subject: [PATCH] [upnpcontrol] Multiple codestyle fixes (#14451) Signed-off-by: lsiepel --- .../upnpcontrol/internal/audiosink/UpnpAudioSinkReg.java | 1 - .../internal/discovery/UpnpControlDiscoveryParticipant.java | 4 ++-- .../binding/upnpcontrol/internal/handler/UpnpHandler.java | 1 - .../upnpcontrol/internal/handler/UpnpRendererHandler.java | 1 - .../upnpcontrol/internal/handler/UpnpServerHandler.java | 1 - .../binding/upnpcontrol/internal/util/StringUtils.java | 3 +++ 6 files changed, 5 insertions(+), 6 deletions(-) diff --git a/bundles/org.openhab.binding.upnpcontrol/src/main/java/org/openhab/binding/upnpcontrol/internal/audiosink/UpnpAudioSinkReg.java b/bundles/org.openhab.binding.upnpcontrol/src/main/java/org/openhab/binding/upnpcontrol/internal/audiosink/UpnpAudioSinkReg.java index 965a92ca313..8c8d959c32c 100644 --- a/bundles/org.openhab.binding.upnpcontrol/src/main/java/org/openhab/binding/upnpcontrol/internal/audiosink/UpnpAudioSinkReg.java +++ b/bundles/org.openhab.binding.upnpcontrol/src/main/java/org/openhab/binding/upnpcontrol/internal/audiosink/UpnpAudioSinkReg.java @@ -13,7 +13,6 @@ package org.openhab.binding.upnpcontrol.internal.audiosink; import org.eclipse.jdt.annotation.NonNullByDefault; -import org.openhab.binding.upnpcontrol.internal.UpnpControlHandlerFactory; import org.openhab.binding.upnpcontrol.internal.handler.UpnpRendererHandler; /** diff --git a/bundles/org.openhab.binding.upnpcontrol/src/main/java/org/openhab/binding/upnpcontrol/internal/discovery/UpnpControlDiscoveryParticipant.java b/bundles/org.openhab.binding.upnpcontrol/src/main/java/org/openhab/binding/upnpcontrol/internal/discovery/UpnpControlDiscoveryParticipant.java index e92111c5a2d..7deb5e8d796 100644 --- a/bundles/org.openhab.binding.upnpcontrol/src/main/java/org/openhab/binding/upnpcontrol/internal/discovery/UpnpControlDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.upnpcontrol/src/main/java/org/openhab/binding/upnpcontrol/internal/discovery/UpnpControlDiscoveryParticipant.java @@ -84,11 +84,11 @@ public class UpnpControlDiscoveryParticipant implements UpnpDiscoveryParticipant logger.debug("Device type {}, manufacturer {}, model {}, SN# {}, UDN {}", deviceType, manufacturer, model, serialNumber, udn); - if (deviceType.equalsIgnoreCase("MediaRenderer")) { + if ("MediaRenderer".equalsIgnoreCase(deviceType)) { this.logger.debug("Media renderer found: {}, {}", manufacturer, model); ThingTypeUID thingTypeUID = THING_TYPE_RENDERER; result = new ThingUID(thingTypeUID, device.getIdentity().getUdn().getIdentifierString()); - } else if (deviceType.equalsIgnoreCase("MediaServer")) { + } else if ("MediaServer".equalsIgnoreCase(deviceType)) { this.logger.debug("Media server found: {}, {}", manufacturer, model); ThingTypeUID thingTypeUID = THING_TYPE_SERVER; result = new ThingUID(thingTypeUID, device.getIdentity().getUdn().getIdentifierString()); diff --git a/bundles/org.openhab.binding.upnpcontrol/src/main/java/org/openhab/binding/upnpcontrol/internal/handler/UpnpHandler.java b/bundles/org.openhab.binding.upnpcontrol/src/main/java/org/openhab/binding/upnpcontrol/internal/handler/UpnpHandler.java index 7d230ab306d..5fc8b04041f 100644 --- a/bundles/org.openhab.binding.upnpcontrol/src/main/java/org/openhab/binding/upnpcontrol/internal/handler/UpnpHandler.java +++ b/bundles/org.openhab.binding.upnpcontrol/src/main/java/org/openhab/binding/upnpcontrol/internal/handler/UpnpHandler.java @@ -29,7 +29,6 @@ import java.util.stream.Collectors; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.jupnp.model.meta.RemoteDevice; -import org.jupnp.registry.RegistryListener; import org.openhab.binding.upnpcontrol.internal.UpnpChannelName; import org.openhab.binding.upnpcontrol.internal.UpnpDynamicCommandDescriptionProvider; import org.openhab.binding.upnpcontrol.internal.UpnpDynamicStateDescriptionProvider; diff --git a/bundles/org.openhab.binding.upnpcontrol/src/main/java/org/openhab/binding/upnpcontrol/internal/handler/UpnpRendererHandler.java b/bundles/org.openhab.binding.upnpcontrol/src/main/java/org/openhab/binding/upnpcontrol/internal/handler/UpnpRendererHandler.java index fe2cdaa78e5..9449ca66646 100644 --- a/bundles/org.openhab.binding.upnpcontrol/src/main/java/org/openhab/binding/upnpcontrol/internal/handler/UpnpRendererHandler.java +++ b/bundles/org.openhab.binding.upnpcontrol/src/main/java/org/openhab/binding/upnpcontrol/internal/handler/UpnpRendererHandler.java @@ -41,7 +41,6 @@ import org.jupnp.model.meta.RemoteDevice; import org.openhab.binding.upnpcontrol.internal.UpnpChannelName; import org.openhab.binding.upnpcontrol.internal.UpnpDynamicCommandDescriptionProvider; import org.openhab.binding.upnpcontrol.internal.UpnpDynamicStateDescriptionProvider; -import org.openhab.binding.upnpcontrol.internal.audiosink.UpnpAudioSink; import org.openhab.binding.upnpcontrol.internal.audiosink.UpnpAudioSinkReg; import org.openhab.binding.upnpcontrol.internal.config.UpnpControlBindingConfiguration; import org.openhab.binding.upnpcontrol.internal.config.UpnpControlRendererConfiguration; diff --git a/bundles/org.openhab.binding.upnpcontrol/src/main/java/org/openhab/binding/upnpcontrol/internal/handler/UpnpServerHandler.java b/bundles/org.openhab.binding.upnpcontrol/src/main/java/org/openhab/binding/upnpcontrol/internal/handler/UpnpServerHandler.java index d8d84f381da..b5970c12084 100644 --- a/bundles/org.openhab.binding.upnpcontrol/src/main/java/org/openhab/binding/upnpcontrol/internal/handler/UpnpServerHandler.java +++ b/bundles/org.openhab.binding.upnpcontrol/src/main/java/org/openhab/binding/upnpcontrol/internal/handler/UpnpServerHandler.java @@ -32,7 +32,6 @@ import java.util.stream.Collectors; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; -import org.openhab.binding.upnpcontrol.internal.UpnpControlHandlerFactory; import org.openhab.binding.upnpcontrol.internal.UpnpDynamicCommandDescriptionProvider; import org.openhab.binding.upnpcontrol.internal.UpnpDynamicStateDescriptionProvider; import org.openhab.binding.upnpcontrol.internal.config.UpnpControlBindingConfiguration; diff --git a/bundles/org.openhab.binding.upnpcontrol/src/main/java/org/openhab/binding/upnpcontrol/internal/util/StringUtils.java b/bundles/org.openhab.binding.upnpcontrol/src/main/java/org/openhab/binding/upnpcontrol/internal/util/StringUtils.java index 2ebb8b8ebc8..080d4b66239 100644 --- a/bundles/org.openhab.binding.upnpcontrol/src/main/java/org/openhab/binding/upnpcontrol/internal/util/StringUtils.java +++ b/bundles/org.openhab.binding.upnpcontrol/src/main/java/org/openhab/binding/upnpcontrol/internal/util/StringUtils.java @@ -12,11 +12,14 @@ */ package org.openhab.binding.upnpcontrol.internal.util; +import org.eclipse.jdt.annotation.NonNullByDefault; + /** * The {@link StringUtils} class defines some static string utility methods * * @author Leo Siepel - Initial contribution */ +@NonNullByDefault public class StringUtils { /**