Java 17 features (A-G) (#15516)

- 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:
Holger Friedrich
2023-09-05 22:30:16 +02:00
committed by GitHub
parent a0dc5c05f2
commit cf10b3e9c7
486 changed files with 2053 additions and 1955 deletions

View File

@@ -93,8 +93,8 @@ public class FroniusBridgeHandler extends BaseBridgeHandler {
@Override
public void childHandlerInitialized(ThingHandler childHandler, Thing childThing) {
if (childHandler instanceof FroniusBaseThingHandler) {
this.services.add((FroniusBaseThingHandler) childHandler);
if (childHandler instanceof FroniusBaseThingHandler handler) {
this.services.add(handler);
restartAutomaticRefresh();
} else {
logger.debug("Child handler {} not added because it is not an instance of FroniusBaseThingHandler",