Java 17 features (H-M) (#15520)

- 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-08 14:36:59 +02:00
committed by GitHub
parent 3751fd0646
commit edaf17b345
519 changed files with 2703 additions and 2660 deletions

View File

@@ -103,7 +103,6 @@ public class MeteoAlertIconProvider implements IconProvider {
AlertLevel alertLevel = ordinal < AlertLevel.values().length ? AlertLevel.values()[ordinal]
: AlertLevel.UNKNOWN;
icon = icon.replaceAll(AlertLevel.UNKNOWN.color, alertLevel.color);
} catch (NumberFormatException e) {
logger.debug("{} is not a valid DecimalType", state);
}

View File

@@ -56,9 +56,11 @@ import com.google.gson.Gson;
@NonNullByDefault
public class MeteoAlerteHandler extends BaseThingHandler {
private static final int TIMEOUT_MS = 30000;
private static final String URL = "https://public.opendatasoft.com/api/records/1.0/search/?dataset=risques-meteorologiques-copy&"
+ "facet=etat_vent&facet=etat_pluie_inondation&facet=etat_orage&facet=etat_inondation&facet=etat_neige&facet=etat_canicule&"
+ "facet=etat_grand_froid&facet=etat_avalanches&refine.nom_dept=%s";
private static final String URL = """
https://public.opendatasoft.com/api/records/1.0/search/?dataset=risques-meteorologiques-copy&\
facet=etat_vent&facet=etat_pluie_inondation&facet=etat_orage&facet=etat_inondation&facet=etat_neige&facet=etat_canicule&\
facet=etat_grand_froid&facet=etat_avalanches&refine.nom_dept=%s\
""";
private final Logger logger = LoggerFactory.getLogger(MeteoAlerteHandler.class);
private final MeteoAlertIconProvider iconProvider;