Java 17 features (N-S) (#15565)
- 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 Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
This commit is contained in:
@@ -64,8 +64,8 @@ public class SomfyMyLinkDeviceDiscoveryService extends AbstractDiscoveryService
|
||||
|
||||
@Override
|
||||
public void setThingHandler(@Nullable ThingHandler handler) {
|
||||
if (handler instanceof SomfyMyLinkBridgeHandler) {
|
||||
this.mylinkHandler = (SomfyMyLinkBridgeHandler) handler;
|
||||
if (handler instanceof SomfyMyLinkBridgeHandler bridgeHandler) {
|
||||
this.mylinkHandler = bridgeHandler;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,9 +25,9 @@ import java.net.SocketTimeoutException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
@@ -145,7 +145,7 @@ public class SomfyMyLinkBridgeHandler extends BaseBridgeHandler {
|
||||
|
||||
@Override
|
||||
public Collection<Class<? extends ThingHandlerService>> getServices() {
|
||||
return Collections.singleton(SomfyMyLinkDeviceDiscoveryService.class);
|
||||
return Set.of(SomfyMyLinkDeviceDiscoveryService.class);
|
||||
}
|
||||
|
||||
private boolean validConfiguration(@Nullable SomfyMyLinkConfiguration config) {
|
||||
|
||||
Reference in New Issue
Block a user