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:
@@ -14,7 +14,6 @@ package org.openhab.binding.publictransportswitzerland.internal;
|
||||
|
||||
import static org.openhab.binding.publictransportswitzerland.internal.PublicTransportSwitzerlandBindingConstants.*;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
@@ -37,7 +36,7 @@ import org.osgi.service.component.annotations.Component;
|
||||
@Component(configurationPid = "binding.publictransportswitzerland", service = ThingHandlerFactory.class)
|
||||
public class PublicTransportSwitzerlandHandlerFactory extends BaseThingHandlerFactory {
|
||||
|
||||
private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections.singleton(THING_TYPE_STATIONBOARD);
|
||||
private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Set.of(THING_TYPE_STATIONBOARD);
|
||||
|
||||
@Override
|
||||
public boolean supportsThingType(ThingTypeUID thingTypeUID) {
|
||||
|
||||
@@ -236,9 +236,10 @@ public class PublicTransportSwitzerlandStationboardHandler extends BaseThingHand
|
||||
|
||||
if (categoryElement == null || numberElement == null || destinationElement == null
|
||||
|| departureTimeElement == null) {
|
||||
logger.warn("Skipping stationboard item."
|
||||
+ "One of the following is null: category: {}, number: {}, destination: {}, departureTime: {}",
|
||||
categoryElement, numberElement, destinationElement, departureTimeElement);
|
||||
logger.warn("""
|
||||
Skipping stationboard item.\
|
||||
One of the following is null: category: {}, number: {}, destination: {}, departureTime: {}\
|
||||
""", categoryElement, numberElement, destinationElement, departureTimeElement);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user