Java 17 features (T-Z) (#15576)
- 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:
@@ -187,8 +187,8 @@ public class TeleinfoDiscoveryService extends AbstractDiscoveryService
|
||||
|
||||
@Override
|
||||
public void setThingHandler(@Nullable ThingHandler handler) {
|
||||
if (handler instanceof TeleinfoAbstractControllerHandler) {
|
||||
controllerHandler = (TeleinfoAbstractControllerHandler) handler;
|
||||
if (handler instanceof TeleinfoAbstractControllerHandler teleinfoAbstractControllerHandler) {
|
||||
controllerHandler = teleinfoAbstractControllerHandler;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
package org.openhab.binding.teleinfo.internal.handler;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
|
||||
@@ -52,6 +51,6 @@ public abstract class TeleinfoAbstractControllerHandler extends BaseBridgeHandle
|
||||
|
||||
@Override
|
||||
public Collection<Class<? extends ThingHandlerService>> getServices() {
|
||||
return Collections.singleton(TeleinfoDiscoveryService.class);
|
||||
return Set.of(TeleinfoDiscoveryService.class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user