From 3a5bee0412f473516be22ecead8f6716a2ad4dae Mon Sep 17 00:00:00 2001 From: mlobstein Date: Wed, 17 Jul 2024 01:38:13 -0500 Subject: [PATCH] fix compiler warning (#17085) Signed-off-by: Michael Lobstein --- .../internal/communication/AmplifierModel.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/bundles/org.openhab.binding.monopriceaudio/src/main/java/org/openhab/binding/monopriceaudio/internal/communication/AmplifierModel.java b/bundles/org.openhab.binding.monopriceaudio/src/main/java/org/openhab/binding/monopriceaudio/internal/communication/AmplifierModel.java index 1c030f19518..15bd88049ea 100644 --- a/bundles/org.openhab.binding.monopriceaudio/src/main/java/org/openhab/binding/monopriceaudio/internal/communication/AmplifierModel.java +++ b/bundles/org.openhab.binding.monopriceaudio/src/main/java/org/openhab/binding/monopriceaudio/internal/communication/AmplifierModel.java @@ -270,7 +270,7 @@ public enum AmplifierModel { public String getZoneIdFromZoneName(String zoneName) { for (String zoneId : zoneIdMap.keySet()) { - if (zoneIdMap.get(zoneId).equals(zoneName)) { + if (zoneName.equals(zoneIdMap.get(zoneId))) { return zoneId; } } @@ -278,12 +278,8 @@ public enum AmplifierModel { } public String getZoneName(String zoneId) { - String zoneName = zoneIdMap.get(zoneId); - if (zoneName != null) { - return zoneName; - } else { - return ""; - } + final String zoneName = zoneIdMap.get(zoneId); + return zoneName != null ? zoneName : ""; } public String getCmdPrefix() {