From: lolodomo Date: Tue, 1 Nov 2022 14:33:54 +0000 (+0100) Subject: [sagercaster] Fix all code analysis findings (#13637) X-Git-Url: https://git.basschouten.com/?a=commitdiff_plain;h=b85e9b43df95d250f493d1eb52a64bc5c15859dd;p=openhab-addons.git [sagercaster] Fix all code analysis findings (#13637) Signed-off-by: Laurent Garnier --- diff --git a/bundles/org.openhab.binding.sagercaster/README.md b/bundles/org.openhab.binding.sagercaster/README.md index c9eadf8a16..3cc96bde95 100644 --- a/bundles/org.openhab.binding.sagercaster/README.md +++ b/bundles/org.openhab.binding.sagercaster/README.md @@ -6,8 +6,7 @@ The Sager Weathercaster is a scientific instrument for accurate prediction of th * To operate, this binding will need to use channel values provided by other means (e.g. Weather Binding, Netatmo, a 1-Wire personal weather station...) -* This binding buffers readings for some hours before producing weather forecasts(wind direction and sea level pressure). -SagerWeatherCaster needs an observation period of minimum 6 hours. +* This binding buffers readings for some hours before producing weather forecasts (wind direction and sea level pressure). SagerWeatherCaster needs an observation period of minimum 6 hours. For these reasons, this binding is not a binding in the usual sense. diff --git a/bundles/org.openhab.binding.sagercaster/src/main/java/org/openhab/binding/sagercaster/internal/SagerCasterBindingConstants.java b/bundles/org.openhab.binding.sagercaster/src/main/java/org/openhab/binding/sagercaster/internal/SagerCasterBindingConstants.java index c5a55cc7e2..a1cf0b6e74 100644 --- a/bundles/org.openhab.binding.sagercaster/src/main/java/org/openhab/binding/sagercaster/internal/SagerCasterBindingConstants.java +++ b/bundles/org.openhab.binding.sagercaster/src/main/java/org/openhab/binding/sagercaster/internal/SagerCasterBindingConstants.java @@ -60,6 +60,6 @@ public class SagerCasterBindingConstants { public static final String CHANNEL_WIND_ANGLE = "wind-angle"; // Some algorythms constants - public final static String FORECAST_PENDING = "0"; - public final static Set SHOWERS = Set.of("G", "K", "L", "R", "S", "T", "U", "W"); + public static final String FORECAST_PENDING = "0"; + public static final Set SHOWERS = Set.of("G", "K", "L", "R", "S", "T", "U", "W"); } diff --git a/bundles/org.openhab.binding.sagercaster/src/main/java/org/openhab/binding/sagercaster/internal/caster/SagerWeatherCaster.java b/bundles/org.openhab.binding.sagercaster/src/main/java/org/openhab/binding/sagercaster/internal/caster/SagerWeatherCaster.java index 75e2203498..8437651d12 100644 --- a/bundles/org.openhab.binding.sagercaster/src/main/java/org/openhab/binding/sagercaster/internal/caster/SagerWeatherCaster.java +++ b/bundles/org.openhab.binding.sagercaster/src/main/java/org/openhab/binding/sagercaster/internal/caster/SagerWeatherCaster.java @@ -76,15 +76,15 @@ import org.slf4j.LoggerFactory; @Component(service = SagerWeatherCaster.class, scope = ServiceScope.SINGLETON) @NonNullByDefault public class SagerWeatherCaster { - public final static String UNDEF = "-"; + public static final String UNDEF = "-"; // Northern Polar Zone & Northern Tropical Zone - private final static String[] NPZDIRECTIONS = { "S", "SW", "W", "NW", "N", "NE", "E", "SE" }; + private static final String[] NPZDIRECTIONS = { "S", "SW", "W", "NW", "N", "NE", "E", "SE" }; // Northern Temperate Zone - private final static String[] NTZDIRECTIONS = { "N", "NE", "E", "SE", "S", "SW", "W", "NW" }; + private static final String[] NTZDIRECTIONS = { "N", "NE", "E", "SE", "S", "SW", "W", "NW" }; // Southern Polar Zone & Southern Tropical Zone - private final static String[] SPZDIRECTIONS = { "N", "NW", "W", "SW", "S", "SE", "E", "NE" }; + private static final String[] SPZDIRECTIONS = { "N", "NW", "W", "SW", "S", "SE", "E", "NE" }; // Southern Temperate Zone - private final static String[] STZDIRECTIONS = { "S", "SE", "E", "NE", "N", "NW", "W", "SW" }; + private static final String[] STZDIRECTIONS = { "S", "SE", "E", "NE", "N", "NW", "W", "SW" }; private final Logger logger = LoggerFactory.getLogger(SagerWeatherCaster.class); private final Properties forecaster = new Properties();