diff --git a/bundles/org.openhab.binding.bluetooth.daikinmadoka/src/test/java/org/openhab/binding/bluetooth/daikinmadoka/internal/MadokaMessageTest.java b/bundles/org.openhab.binding.bluetooth.daikinmadoka/src/test/java/org/openhab/binding/bluetooth/daikinmadoka/internal/MadokaMessageTest.java index 0ee0f245f..bbe06711e 100644 --- a/bundles/org.openhab.binding.bluetooth.daikinmadoka/src/test/java/org/openhab/binding/bluetooth/daikinmadoka/internal/MadokaMessageTest.java +++ b/bundles/org.openhab.binding.bluetooth.daikinmadoka/src/test/java/org/openhab/binding/bluetooth/daikinmadoka/internal/MadokaMessageTest.java @@ -64,11 +64,7 @@ public class MadokaMessageTest { @Test public void testParseOperationHours() { - String s = "390001120201004004DC0B00004104F40300004204642300004304000000004404000000004504000000004604000000004704000000004800"; - MadokaValue mv = new MadokaValue(0, 4, new byte[] { (byte) 0xF4, 0x03, 0x00, 0x00 }); - // MadokaValue mv = new MadokaValue(0, 4, new byte[] { 0x00, 0x00, 0x03, (byte) 0xF4 }); - Long v = mv.getComputedValue(ByteOrder.LITTLE_ENDIAN); assertEquals(1012, v); } diff --git a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/handler/DaikinBaseHandler.java b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/handler/DaikinBaseHandler.java index cd6dd74ee..76357e480 100644 --- a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/handler/DaikinBaseHandler.java +++ b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/handler/DaikinBaseHandler.java @@ -38,7 +38,6 @@ import org.openhab.core.thing.ChannelUID; import org.openhab.core.thing.Thing; import org.openhab.core.thing.ThingStatus; import org.openhab.core.thing.ThingStatusDetail; -import org.openhab.core.thing.ThingTypeUID; import org.openhab.core.thing.binding.BaseThingHandler; import org.openhab.core.types.Command; import org.openhab.core.types.State; @@ -227,7 +226,6 @@ public abstract class DaikinBaseHandler extends BaseThingHandler { } private void changeHomekitMode(String homekitmode) throws DaikinCommunicationException { - ThingTypeUID thingTypeUID = thing.getThingTypeUID(); if (HomekitMode.OFF.getValue().equals(homekitmode)) { changePower(false); } else { diff --git a/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/FSInternetRadioDiscoveryParticipant.java b/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/FSInternetRadioDiscoveryParticipant.java index dd4d8b9fc..32dcfe40f 100644 --- a/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/FSInternetRadioDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/FSInternetRadioDiscoveryParticipant.java @@ -270,12 +270,10 @@ public class FSInternetRadioDiscoveryParticipant implements UpnpDiscoveryPartici // Some devices report crappy UPnP device description so manufacturer and model are "" // In this case we try to find the match in friendlyName final String uname = friendlyName.toUpperCase(); - for (Map.Entry> entry : SUPPORTED_RADIO_MODELS.entrySet()) { - for (Set set : SUPPORTED_RADIO_MODELS.values()) { - for (String model : set) { - if ((model != null) && !model.isEmpty() && uname.contains(model)) { - return new ThingUID(THING_TYPE_RADIO, serialNumber); - } + for (Set set : SUPPORTED_RADIO_MODELS.values()) { + for (String model : set) { + if ((model != null) && !model.isEmpty() && uname.contains(model)) { + return new ThingUID(THING_TYPE_RADIO, serialNumber); } } } diff --git a/bundles/org.openhab.binding.hdanywhere/src/main/java/org/openhab/binding/hdanywhere/internal/handler/Mhub4K431Handler.java b/bundles/org.openhab.binding.hdanywhere/src/main/java/org/openhab/binding/hdanywhere/internal/handler/Mhub4K431Handler.java index 79b114d45..9ea81044c 100644 --- a/bundles/org.openhab.binding.hdanywhere/src/main/java/org/openhab/binding/hdanywhere/internal/handler/Mhub4K431Handler.java +++ b/bundles/org.openhab.binding.hdanywhere/src/main/java/org/openhab/binding/hdanywhere/internal/handler/Mhub4K431Handler.java @@ -151,7 +151,7 @@ public class Mhub4K431Handler extends BaseThingHandler { httpHeaders.setProperty("Cookie", "logintype-88=01"); try { - String response = HttpUtil.executeUrl(httpMethod, url, httpHeaders, stream, + HttpUtil.executeUrl(httpMethod, url, httpHeaders, stream, "application/x-www-form-urlencoded; charset=UTF-8", timeout); } catch (IOException e) { logger.debug("Communication with device failed", e); diff --git a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/handler/HeliosHandler27.java b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/handler/HeliosHandler27.java index abf829d93..25c12aab3 100644 --- a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/handler/HeliosHandler27.java +++ b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/handler/HeliosHandler27.java @@ -49,7 +49,6 @@ import org.oasis_open.docs.wsn.b_2.Subscribe; import org.oasis_open.docs.wsn.b_2.SubscribeResponse; import org.oasis_open.docs.wsn.b_2.TopicExpressionType; import org.oasis_open.docs.wsn.b_2.Unsubscribe; -import org.oasis_open.docs.wsn.b_2.UnsubscribeResponse; import org.oasis_open.docs.wsn.bw_2.InvalidFilterFault; import org.oasis_open.docs.wsn.bw_2.InvalidMessageContentExpressionFault; import org.oasis_open.docs.wsn.bw_2.InvalidProducerPropertiesExpressionFault; @@ -347,7 +346,7 @@ public class HeliosHandler27 extends BaseThingHandler implements NotificationCon public void unsubscribe() { if (subscription != null) { try { - UnsubscribeResponse response = subscription.unsubscribe(new Unsubscribe()); + subscription.unsubscribe(new Unsubscribe()); logger.debug("Unsubscribing the subscription with ID '{}' for '{}' ", getSubscriptionID(), getThing().getUID()); } catch (UnableToDestroySubscriptionFault | ResourceUnknownFault e) { diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/manager/DeviceStructureManager.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/manager/DeviceStructureManager.java index 5be3b1dee..da4d5f323 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/manager/DeviceStructureManager.java +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/manager/DeviceStructureManager.java @@ -25,7 +25,6 @@ import org.eclipse.jdt.annotation.Nullable; import org.openhab.binding.innogysmarthome.internal.InnogyBindingConstants; import org.openhab.binding.innogysmarthome.internal.client.InnogyClient; import org.openhab.binding.innogysmarthome.internal.client.entity.capability.Capability; -import org.openhab.binding.innogysmarthome.internal.client.entity.capability.State; import org.openhab.binding.innogysmarthome.internal.client.entity.device.Device; import org.openhab.binding.innogysmarthome.internal.client.entity.link.Link; import org.openhab.binding.innogysmarthome.internal.client.entity.message.Message; @@ -131,9 +130,7 @@ public class DeviceStructureManager { if (d.isRadioDevice() && !d.isReachable()) { logger.debug(">> CAP-State: unknown (device NOT REACHABLE)."); } else { - if (c.hasState()) { - final State state = c.getCapabilityState().getState(); - } else { + if (!c.hasState()) { logger.debug(">> CAP-State: unknown (NULL)"); } } diff --git a/bundles/org.openhab.binding.irtrans/src/main/java/org/openhab/binding/irtrans/internal/handler/EthernetBridgeHandler.java b/bundles/org.openhab.binding.irtrans/src/main/java/org/openhab/binding/irtrans/internal/handler/EthernetBridgeHandler.java index 4e0aae384..4992ebc34 100644 --- a/bundles/org.openhab.binding.irtrans/src/main/java/org/openhab/binding/irtrans/internal/handler/EthernetBridgeHandler.java +++ b/bundles/org.openhab.binding.irtrans/src/main/java/org/openhab/binding/irtrans/internal/handler/EthernetBridgeHandler.java @@ -849,7 +849,6 @@ public class EthernetBridgeHandler extends BaseBridgeHandler implements Transcei Matcher matcher = RESPONSE_PATTERN.matcher(response); if (matcher.matches()) { - String byteCountAsString = matcher.group(1); message = matcher.group(2); } diff --git a/bundles/org.openhab.binding.keba/src/main/java/org/openhab/binding/keba/internal/handler/KeContactTransceiver.java b/bundles/org.openhab.binding.keba/src/main/java/org/openhab/binding/keba/internal/handler/KeContactTransceiver.java index 61139dfe0..df21760ce 100644 --- a/bundles/org.openhab.binding.keba/src/main/java/org/openhab/binding/keba/internal/handler/KeContactTransceiver.java +++ b/bundles/org.openhab.binding.keba/src/main/java/org/openhab/binding/keba/internal/handler/KeContactTransceiver.java @@ -254,7 +254,7 @@ public class KeContactTransceiver { new Object[] { new String(theBuffer.array()), theChannel.getLocalAddress(), theChannel.getRemoteAddress() }); - int byteswritten = theChannel.write(theBuffer); + theChannel.write(theBuffer); } catch (NotYetConnectedException e) { theHandler.updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, diff --git a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/MieleApplianceHandler.java b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/MieleApplianceHandler.java index b3ba33c19..560eed510 100644 --- a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/MieleApplianceHandler.java +++ b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/MieleApplianceHandler.java @@ -23,7 +23,6 @@ import java.util.stream.Stream; import org.apache.commons.lang3.StringUtils; import org.openhab.binding.miele.internal.handler.MieleBridgeHandler.DeviceClassObject; import org.openhab.binding.miele.internal.handler.MieleBridgeHandler.DeviceMetaData; -import org.openhab.binding.miele.internal.handler.MieleBridgeHandler.DeviceOperation; import org.openhab.binding.miele.internal.handler.MieleBridgeHandler.DeviceProperty; import org.openhab.binding.miele.internal.handler.MieleBridgeHandler.HomeDevice; import org.openhab.core.thing.Bridge; @@ -162,15 +161,6 @@ public abstract class MieleApplianceHandler & ApplianceChannel // Ignore - this is due to an unrecognized and not yet reverse-engineered array property } } - - for (JsonElement operation : dco.Operations.getAsJsonArray()) { - try { - DeviceOperation devop = gson.fromJson(operation, DeviceOperation.class); - DeviceMetaData pmd = gson.fromJson(devop.Metadata, DeviceMetaData.class); - } catch (Exception p) { - // Ignore - this is due to an unrecognized and not yet reverse-engineered array property - } - } } } } diff --git a/bundles/org.openhab.binding.modbus/src/test/java/org/openhab/binding/modbus/internal/AtomicStampedKeyValueTest.java b/bundles/org.openhab.binding.modbus/src/test/java/org/openhab/binding/modbus/internal/AtomicStampedKeyValueTest.java index 9eca1d4cc..fd7658a05 100644 --- a/bundles/org.openhab.binding.modbus/src/test/java/org/openhab/binding/modbus/internal/AtomicStampedKeyValueTest.java +++ b/bundles/org.openhab.binding.modbus/src/test/java/org/openhab/binding/modbus/internal/AtomicStampedKeyValueTest.java @@ -84,7 +84,6 @@ public class AtomicStampedKeyValueTest { */ @Test public void testCopyIfStampAfterEqual() { - Object key = new Object(); Object val = new Object(); AtomicStampedValue keyValue = new AtomicStampedValue<>(42L, val); AtomicStampedValue copy = keyValue.copyIfStampAfter(42L); @@ -98,7 +97,6 @@ public class AtomicStampedKeyValueTest { assertThat(keyValue.getValue(), is(equalTo(copy.getValue()))); // after update they live life of their own - Object key2 = new Object(); Object val2 = new Object(); copy.update(-99L, val2); @@ -144,7 +142,6 @@ public class AtomicStampedKeyValueTest { assertThat(keyValue.getValue(), is(equalTo(copy.getValue()))); // after update they live life of their own - Object key2 = new Object(); Object val2 = new Object(); copy.update(-99L, val2); diff --git a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/handler/AbstractBrokerHandler.java b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/handler/AbstractBrokerHandler.java index 52381ba11..dc5dbb3fa 100644 --- a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/handler/AbstractBrokerHandler.java +++ b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/handler/AbstractBrokerHandler.java @@ -230,28 +230,27 @@ public abstract class AbstractBrokerHandler extends BaseBridgeHandler implements * @param topic the topic (as specified during registration) */ public final void unregisterDiscoveryListener(MQTTTopicDiscoveryParticipant listener, String topic) { - Map topicListeners = discoveryTopics.compute(topic, - (k, v) -> { - if (v == null) { - logger.warn( - "Tried to unsubscribe {} from discovery topic {} on broker {} but topic not registered at all. Check discovery logic!", - listener, topic, thing.getUID()); - return null; - } - v.compute(listener, (l, w) -> { - if (w == null) { - logger.warn( - "Tried to unsubscribe {} from discovery topic {} on broker {} but topic not registered for listener. Check discovery logic!", - listener, topic, thing.getUID()); - } else { - w.stop(); - logger.trace("Unsubscribed {} from discovery topic {} on broker {}", listener, topic, - thing.getUID()); - } - return null; - }); - return v.isEmpty() ? null : v; - }); + discoveryTopics.compute(topic, (k, v) -> { + if (v == null) { + logger.warn( + "Tried to unsubscribe {} from discovery topic {} on broker {} but topic not registered at all. Check discovery logic!", + listener, topic, thing.getUID()); + return null; + } + v.compute(listener, (l, w) -> { + if (w == null) { + logger.warn( + "Tried to unsubscribe {} from discovery topic {} on broker {} but topic not registered for listener. Check discovery logic!", + listener, topic, thing.getUID()); + } else { + w.stop(); + logger.trace("Unsubscribed {} from discovery topic {} on broker {}", listener, topic, + thing.getUID()); + } + return null; + }); + return v.isEmpty() ? null : v; + }); } /** diff --git a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/handler/ShellyComponents.java b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/handler/ShellyComponents.java index fa0cc1333..8b8ab9d9b 100644 --- a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/handler/ShellyComponents.java +++ b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/handler/ShellyComponents.java @@ -263,7 +263,6 @@ public class ShellyComponents { updated |= thingHandler.updateChannel(CHANNEL_GROUP_SENSOR, CHANNEL_SENSOR_CONTACT, getString(sdata.sensor.state).equalsIgnoreCase(SHELLY_API_DWSTATE_OPEN) ? OpenClosedType.OPEN : OpenClosedType.CLOSED); - String sensorError = getString(sdata.sensorError); boolean changed = thingHandler.updateChannel(CHANNEL_GROUP_SENSOR, CHANNEL_SENSOR_ERROR, getStringType(sdata.sensorError)); if (changed) { diff --git a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/manager/ShellyManagerActionPage.java b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/manager/ShellyManagerActionPage.java index 927fbe6cb..38ede361c 100644 --- a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/manager/ShellyManagerActionPage.java +++ b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/manager/ShellyManagerActionPage.java @@ -227,7 +227,7 @@ public class ShellyManagerActionPage extends ShellyManagerPage { actionUrl = buildActionUrl(uid, action); } else { try { - String result = api.resetStaCache(); + api.resetStaCache(); message = getMessage("action.resetsta-confirm"); } catch (ShellyApiException e) { message = getMessageP("action.resetsta-failed", e.toString()); @@ -243,7 +243,7 @@ public class ShellyManagerActionPage extends ShellyManagerPage { actionUrl = buildActionUrl(uid, action); } else { try { - String result = api.setWiFiRecovery(enable); + api.setWiFiRecovery(enable); message = getMessage("action.setwifirec-confirm", enable ? "enabled" : "disabled"); } catch (ShellyApiException e) { message = getMessage("action.setwifirec-failed", e.toString()); @@ -260,7 +260,7 @@ public class ShellyManagerActionPage extends ShellyManagerPage { actionUrl = buildActionUrl(uid, action); } else { try { - String result = api.setApRoaming(enable); + api.setApRoaming(enable); message = getMessage("action.aproaming-confirm", enable ? "enabled" : "disabled"); } catch (ShellyApiException e) { message = getMessage("action.aproaming-failed", e.toString()); diff --git a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/manager/ShellyManagerCache.java b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/manager/ShellyManagerCache.java index 5af3e0fb8..9655e9dbe 100644 --- a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/manager/ShellyManagerCache.java +++ b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/manager/ShellyManagerCache.java @@ -91,7 +91,7 @@ public class ShellyManagerCache extends ConcurrentHashMap { long currentTime = new Date().getTime(); for (K key : timeMap.keySet()) { if (currentTime > (timeMap.get(key) + expiryInMillis)) { - V value = remove(key); + remove(key); timeMap.remove(key); } } diff --git a/bundles/org.openhab.binding.valloxmv/src/main/java/org/openhab/binding/valloxmv/internal/ValloxMVWebSocket.java b/bundles/org.openhab.binding.valloxmv/src/main/java/org/openhab/binding/valloxmv/internal/ValloxMVWebSocket.java index 13a292283..62f0adbb8 100644 --- a/bundles/org.openhab.binding.valloxmv/src/main/java/org/openhab/binding/valloxmv/internal/ValloxMVWebSocket.java +++ b/bundles/org.openhab.binding.valloxmv/src/main/java/org/openhab/binding/valloxmv/internal/ValloxMVWebSocket.java @@ -430,6 +430,7 @@ public class ValloxMVWebSocket { BigDecimal bdTempIncoming = getTemperature(bytes, 138); int iHumidity = getNumberBE(bytes, 148); + @SuppressWarnings("unused") int iCo2 = getNumberBE(bytes, 150); int iStateOrig = getNumberBE(bytes, 214); diff --git a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyItemRegistry.java b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyItemRegistry.java index 88cab2eb2..f83200c99 100644 --- a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyItemRegistry.java +++ b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyItemRegistry.java @@ -62,7 +62,7 @@ public class DummyItemRegistry implements ItemRegistry { @Override public Item add(Item element) { - Item put = items.put(element.getUID(), element); + items.put(element.getUID(), element); for (RegistryChangeListener l : listeners) { l.added(element); } diff --git a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyMetadataRegistry.java b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyMetadataRegistry.java index b61b85c7b..b6a312548 100644 --- a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyMetadataRegistry.java +++ b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyMetadataRegistry.java @@ -61,7 +61,7 @@ public class DummyMetadataRegistry implements MetadataRegistry { @Override public Metadata add(Metadata element) { - Metadata put = items.put(element.getUID(), element); + items.put(element.getUID(), element); for (RegistryChangeListener l : listeners) { l.added(element); } diff --git a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyRuleRegistry.java b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyRuleRegistry.java index 740dc3414..a27068730 100644 --- a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyRuleRegistry.java +++ b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyRuleRegistry.java @@ -61,7 +61,7 @@ public class DummyRuleRegistry implements RuleRegistry { @Override public Rule add(Rule element) { - Rule put = items.put(element.getUID(), element); + items.put(element.getUID(), element); for (RegistryChangeListener l : listeners) { l.added(element); } diff --git a/itests/org.openhab.binding.modbus.tests/src/main/java/org/openhab/binding/modbus/tests/ModbusDataHandlerTest.java b/itests/org.openhab.binding.modbus.tests/src/main/java/org/openhab/binding/modbus/tests/ModbusDataHandlerTest.java index 5cd510e09..1f3cf38aa 100644 --- a/itests/org.openhab.binding.modbus.tests/src/main/java/org/openhab/binding/modbus/tests/ModbusDataHandlerTest.java +++ b/itests/org.openhab.binding.modbus.tests/src/main/java/org/openhab/binding/modbus/tests/ModbusDataHandlerTest.java @@ -70,7 +70,6 @@ import org.openhab.core.thing.ThingStatus; import org.openhab.core.thing.ThingStatusDetail; import org.openhab.core.thing.ThingStatusInfo; import org.openhab.core.thing.ThingUID; -import org.openhab.core.thing.binding.ThingHandler; import org.openhab.core.thing.binding.builder.BridgeBuilder; import org.openhab.core.thing.binding.builder.ChannelBuilder; import org.openhab.core.thing.binding.builder.ThingBuilder; @@ -154,7 +153,6 @@ public class ModbusDataHandlerTest extends AbstractModbusOSGiTest { } private Bridge createTcpMock() { - ModbusSlaveEndpoint endpoint = new ModbusTCPSlaveEndpoint("thisishost", 502, false); Bridge tcpBridge = ModbusPollerThingHandlerTest.createTcpThingBuilder("tcp1").build(); ModbusTcpThingHandler tcpThingHandler = Mockito.mock(ModbusTcpThingHandler.class); tcpBridge.setStatusInfo(new ThingStatusInfo(ThingStatus.ONLINE, ThingStatusDetail.NONE, "")); @@ -824,7 +822,6 @@ public class ModbusDataHandlerTest extends AbstractModbusOSGiTest { assertThat(dataHandler.getThing().getStatus(), is(equalTo(ThingStatus.ONLINE))); verify(comms, never()).submitOneTimePoll(eq(request), notNull(), notNull()); - ModbusPollerThingHandler handler = (ModbusPollerThingHandler) poller.getHandler(); // Wait for all channels to receive the REFRESH command (initiated by the core) waitForAssert( () -> verify((ModbusPollerThingHandler) poller.getHandler(), times(CHANNEL_TO_ACCEPTED_TYPE.size())) @@ -854,7 +851,6 @@ public class ModbusDataHandlerTest extends AbstractModbusOSGiTest { Bridge parent; if (pollerFunctionCode == null) { parent = createTcpMock(); - ThingHandler foo = parent.getHandler(); addThing(parent); } else { ModbusSlaveEndpoint endpoint = new ModbusTCPSlaveEndpoint("thisishost", 502, false); diff --git a/itests/org.openhab.binding.wemo.tests/src/main/java/org/openhab/binding/wemo/internal/test/GenericWemoLightOSGiTestParent.java b/itests/org.openhab.binding.wemo.tests/src/main/java/org/openhab/binding/wemo/internal/test/GenericWemoLightOSGiTestParent.java index 86e5a824c..b23e8f77d 100644 --- a/itests/org.openhab.binding.wemo.tests/src/main/java/org/openhab/binding/wemo/internal/test/GenericWemoLightOSGiTestParent.java +++ b/itests/org.openhab.binding.wemo.tests/src/main/java/org/openhab/binding/wemo/internal/test/GenericWemoLightOSGiTestParent.java @@ -16,7 +16,6 @@ import static org.hamcrest.CoreMatchers.*; import static org.hamcrest.MatcherAssert.assertThat; import org.openhab.binding.wemo.internal.WemoBindingConstants; -import org.openhab.binding.wemo.internal.handler.AbstractWemoHandler; import org.openhab.core.config.core.Configuration; import org.openhab.core.thing.Bridge; import org.openhab.core.thing.Channel; @@ -25,7 +24,6 @@ import org.openhab.core.thing.Thing; import org.openhab.core.thing.ThingStatus; import org.openhab.core.thing.ThingTypeUID; import org.openhab.core.thing.ThingUID; -import org.openhab.core.thing.binding.ThingHandler; import org.openhab.core.thing.binding.builder.BridgeBuilder; import org.openhab.core.thing.binding.builder.ChannelBuilder; import org.openhab.core.thing.binding.builder.ThingBuilder; @@ -85,12 +83,6 @@ public class GenericWemoLightOSGiTestParent extends GenericWemoOSGiTest { .withBridge(bridgeUID).build(); managedThingProvider.add(thing); - - ThingHandler handler = thing.getHandler(); - if (handler != null) { - AbstractWemoHandler h = (AbstractWemoHandler) handler; - } - return thing; }