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:
Holger Friedrich
2023-09-21 07:58:53 +02:00
committed by GitHub
parent bf1aa3deb2
commit 1b122a53b9
277 changed files with 1402 additions and 1298 deletions

View File

@@ -74,6 +74,5 @@ public class VitotronicBindingConstants {
THING_TYPE_UID_TEMPERATURESENSOR, THING_TYPE_UID_PUMP, THING_TYPE_UID_VALVE)
.collect(Collectors.toSet()));
public static final Set<ThingTypeUID> SUPPORTED_BRIDGE_THING_TYPES_UIDS = Collections
.singleton(THING_TYPE_UID_BRIDGE);
public static final Set<ThingTypeUID> SUPPORTED_BRIDGE_THING_TYPES_UIDS = Set.of(THING_TYPE_UID_BRIDGE);
}

View File

@@ -82,8 +82,8 @@ public class VitotronicThingHandler extends BaseThingHandler {
VitotronicBridgeHandler bridgeHandler = null;
ThingHandler handler = bridge.getHandler();
if (handler instanceof VitotronicBridgeHandler) {
bridgeHandler = (VitotronicBridgeHandler) handler;
if (handler instanceof VitotronicBridgeHandler vitotronicBridgeHandler) {
bridgeHandler = vitotronicBridgeHandler;
} else {
logger.debug("No available bridge handler found yet. Bridge: {} .", bridge.getUID());
bridgeHandler = null;