Java 17 features (H-M) (#15520)
- add missing @override - Java style array syntax - remove redundant modifiers - always move String constants to left side in comparisons - simplify lambda expressions and return statements - use replace instead of replaceAll w/o regex - instanceof matching and multiline strings - remove null check before instanceof Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
This commit is contained in:
@@ -68,8 +68,7 @@ public class JuiceNetDiscoveryService extends AbstractDiscoveryService
|
||||
|
||||
@Override
|
||||
public void setThingHandler(@Nullable ThingHandler handler) {
|
||||
if (handler instanceof JuiceNetBridgeHandler) {
|
||||
JuiceNetBridgeHandler bridgeHandler = (JuiceNetBridgeHandler) handler;
|
||||
if (handler instanceof JuiceNetBridgeHandler bridgeHandler) {
|
||||
bridgeHandler.setDiscoveryService(this);
|
||||
this.bridgeHandler = bridgeHandler;
|
||||
} else {
|
||||
|
||||
@@ -15,9 +15,9 @@ package org.openhab.binding.juicenet.internal.handler;
|
||||
import static org.openhab.binding.juicenet.internal.JuiceNetBindingConstants.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@@ -116,7 +116,7 @@ public class JuiceNetBridgeHandler extends BaseBridgeHandler {
|
||||
*/
|
||||
@Override
|
||||
public Collection<Class<? extends ThingHandlerService>> getServices() {
|
||||
return Collections.singleton(JuiceNetDiscoveryService.class);
|
||||
return Set.of(JuiceNetDiscoveryService.class);
|
||||
}
|
||||
|
||||
public void handleApiException(Exception e) {
|
||||
|
||||
Reference in New Issue
Block a user