diff --git a/bundles/org.openhab.core.automation.module.script/src/main/java/org/openhab/core/automation/module/script/internal/ScriptEngineManagerImpl.java b/bundles/org.openhab.core.automation.module.script/src/main/java/org/openhab/core/automation/module/script/internal/ScriptEngineManagerImpl.java index ed5bc0a76..474217d79 100644 --- a/bundles/org.openhab.core.automation.module.script/src/main/java/org/openhab/core/automation/module/script/internal/ScriptEngineManagerImpl.java +++ b/bundles/org.openhab.core.automation.module.script/src/main/java/org/openhab/core/automation/module/script/internal/ScriptEngineManagerImpl.java @@ -44,9 +44,9 @@ import org.slf4j.LoggerFactory; public class ScriptEngineManagerImpl implements ScriptEngineManager { private final Logger logger = LoggerFactory.getLogger(ScriptEngineManagerImpl.class); - private final Map loadedScriptEngineInstances = new HashMap<>(); - private final Map customSupport = new HashMap<>(); - private final Map genericSupport = new HashMap<>(); + private final Map loadedScriptEngineInstances = new HashMap<>(); + private final Map customSupport = new HashMap<>(); + private final Map genericSupport = new HashMap<>(); private final ScriptExtensionManager scriptExtensionManager; @Activate diff --git a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/RuleEngineImpl.java b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/RuleEngineImpl.java index bd1d2c37b..f0999ac4d 100644 --- a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/RuleEngineImpl.java +++ b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/RuleEngineImpl.java @@ -124,26 +124,26 @@ public class RuleEngineImpl implements RuleManager, RegistryChangeListener managedRules = new ConcurrentHashMap<>(); + private final Map managedRules = new ConcurrentHashMap<>(); /** * {@link Map} holding all created {@link TriggerHandlerCallback} instances, corresponding to each {@link Rule}. * There is only one {@link TriggerHandlerCallback} instance per {@link Rule}. The relation is * {@link Rule}'s UID to {@link TriggerHandlerCallback} instance. */ - private final Map thCallbacks = new HashMap<>(); + private final Map thCallbacks = new HashMap<>(); /** * {@link Map} holding all {@link ModuleType} UIDs that are available in some rule's module definition. The relation * is {@link ModuleType}'s UID to {@link Set} of {@link Rule} UIDs. */ - private final Map> mapModuleTypeToRules = new HashMap<>(); + private final Map> mapModuleTypeToRules = new HashMap<>(); /** * {@link Map} holding all available {@link ModuleHandlerFactory}s linked with {@link ModuleType}s that they * supporting. The relation is {@link ModuleType}'s UID to {@link ModuleHandlerFactory} instance. */ - private final Map moduleHandlerFactories; + private final Map moduleHandlerFactories; /** * {@link Set} holding all available {@link ModuleHandlerFactory}s. @@ -173,7 +173,7 @@ public class RuleEngineImpl implements RuleManager, RegistryChangeListener> contextMap; + private final Map> contextMap; /** * This field holds reference to {@link ModuleTypeRegistry}. The {@link RuleEngineImpl} needs it to auto-map @@ -191,7 +191,7 @@ public class RuleEngineImpl implements RuleManager, RegistryChangeListener> scheduleTasks = new HashMap<>(31); + private final Map> scheduleTasks = new HashMap<>(31); /** * Performs the {@link Rule} re-initialization tasks. @@ -757,9 +757,9 @@ public class RuleEngineImpl implements RuleManager, RegistryChangeListener>> it = mapModuleTypeToRules.entrySet() - .iterator(); it.hasNext();) { - Map.Entry> e = it.next(); + for (Iterator>> it = mapModuleTypeToRules.entrySet().iterator(); it + .hasNext();) { + Map.Entry> e = it.next(); Set rules = e.getValue(); if (rules != null && rules.contains(rUID)) { rules.remove(rUID); @@ -911,7 +911,7 @@ public class RuleEngineImpl implements RuleManager, RegistryChangeListener moduleTypes) { - Map> mapMissingHandlers = null; + Map> mapMissingHandlers = null; for (String moduleTypeName : moduleTypes) { Set rules = null; synchronized (this) { @@ -941,7 +941,7 @@ public class RuleEngineImpl implements RuleManager, RegistryChangeListener> e : mapMissingHandlers.entrySet()) { + for (Entry> e : mapMissingHandlers.entrySet()) { String rUID = e.getKey(); List missingTypes = e.getValue(); StringBuffer sb = new StringBuffer(); @@ -1053,7 +1053,7 @@ public class RuleEngineImpl implements RuleManager, RegistryChangeListener context = contextMap.get(ruleUID); + Map context = contextMap.get(ruleUID); if (context != null) { context.clear(); } @@ -1077,7 +1077,7 @@ public class RuleEngineImpl implements RuleManager, RegistryChangeListener outputs) { - Map context = getContext(ruleUID, null); + Map context = getContext(ruleUID, null); if (outputs != null) { for (Map.Entry entry : outputs.entrySet()) { String key = moduleUID + OUTPUT_SEPARATOR + entry.getKey(); @@ -1089,8 +1089,8 @@ public class RuleEngineImpl implements RuleManager, RegistryChangeListener getContext(String ruleUID, @Nullable Set connections) { - Map context = contextMap.get(ruleUID); + private Map getContext(String ruleUID, @Nullable Set connections) { + Map context = contextMap.get(ruleUID); if (context == null) { context = new HashMap<>(); contextMap.put(ruleUID, context); @@ -1145,7 +1145,7 @@ public class RuleEngineImpl implements RuleManager, RegistryChangeListener context = getContext(ruleUID, wrappedCondition.getConnections()); + Map context = getContext(ruleUID, wrappedCondition.getConnections()); if (tHandler != null && !tHandler.isSatisfied(Collections.unmodifiableMap(context))) { logger.debug("The condition '{}' of rule '{}' is unsatisfied.", condition.getId(), ruleUID); return false; @@ -1174,7 +1174,7 @@ public class RuleEngineImpl implements RuleManager, RegistryChangeListener context = getContext(ruleUID, wrappedAction.getConnections()); + Map context = getContext(ruleUID, wrappedAction.getConnections()); try { Map outputs = aHandler.execute(Collections.unmodifiableMap(context)); if (outputs != null) { @@ -1358,7 +1358,7 @@ public class RuleEngineImpl implements RuleManager, RegistryChangeListener outputs, Map, @Nullable OutputRef> tagMap) { + private void initTagsMap(String moduleId, List outputs, Map, OutputRef> tagMap) { for (Output output : outputs) { Set tags = output.getTags(); if (!tags.isEmpty()) { diff --git a/bundles/org.openhab.core.config.discovery.mdns/src/main/java/org/openhab/core/config/discovery/mdns/internal/MDNSDiscoveryService.java b/bundles/org.openhab.core.config.discovery.mdns/src/main/java/org/openhab/core/config/discovery/mdns/internal/MDNSDiscoveryService.java index 37bbe1137..a0420b94d 100644 --- a/bundles/org.openhab.core.config.discovery.mdns/src/main/java/org/openhab/core/config/discovery/mdns/internal/MDNSDiscoveryService.java +++ b/bundles/org.openhab.core.config.discovery.mdns/src/main/java/org/openhab/core/config/discovery/mdns/internal/MDNSDiscoveryService.java @@ -62,7 +62,7 @@ public class MDNSDiscoveryService extends AbstractDiscoveryService implements Se private final MDNSClient mdnsClient; @Activate - public MDNSDiscoveryService(final @Nullable Map configProperties, + public MDNSDiscoveryService(final @Nullable Map configProperties, final @Reference MDNSClient mdnsClient) { super(5); @@ -89,7 +89,7 @@ public class MDNSDiscoveryService extends AbstractDiscoveryService implements Se @Modified @Override - protected void modified(@Nullable Map configProperties) { + protected void modified(@Nullable Map configProperties) { super.modified(configProperties); } diff --git a/bundles/org.openhab.core.config.discovery.usbserial/src/main/java/org/openhab/core/config/discovery/usbserial/internal/UsbSerialDiscoveryService.java b/bundles/org.openhab.core.config.discovery.usbserial/src/main/java/org/openhab/core/config/discovery/usbserial/internal/UsbSerialDiscoveryService.java index 76eb23490..2f9e3c2a1 100644 --- a/bundles/org.openhab.core.config.discovery.usbserial/src/main/java/org/openhab/core/config/discovery/usbserial/internal/UsbSerialDiscoveryService.java +++ b/bundles/org.openhab.core.config.discovery.usbserial/src/main/java/org/openhab/core/config/discovery/usbserial/internal/UsbSerialDiscoveryService.java @@ -81,14 +81,14 @@ public class UsbSerialDiscoveryService extends AbstractDiscoveryService implemen @Override @Activate - protected void activate(@Nullable Map configProperties) { + protected void activate(@Nullable Map configProperties) { super.activate(configProperties); usbSerialDiscovery.registerDiscoveryListener(this); } @Modified @Override - protected void modified(@Nullable Map configProperties) { + protected void modified(@Nullable Map configProperties) { super.modified(configProperties); } diff --git a/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/AbstractDiscoveryService.java b/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/AbstractDiscoveryService.java index 5c0f67e04..86861c635 100644 --- a/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/AbstractDiscoveryService.java +++ b/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/AbstractDiscoveryService.java @@ -360,7 +360,7 @@ public abstract class AbstractDiscoveryService implements DiscoveryService { * * @param configProperties configuration properties */ - protected void activate(@Nullable Map configProperties) { + protected void activate(@Nullable Map configProperties) { if (configProperties != null) { Object property = configProperties.get(DiscoveryService.CONFIG_PROPERTY_BACKGROUND_DISCOVERY); if (property != null) { @@ -383,7 +383,7 @@ public abstract class AbstractDiscoveryService implements DiscoveryService { * * @param configProperties configuration properties */ - protected void modified(@Nullable Map configProperties) { + protected void modified(@Nullable Map configProperties) { if (configProperties != null) { Object property = configProperties.get(DiscoveryService.CONFIG_PROPERTY_BACKGROUND_DISCOVERY); if (property != null) { diff --git a/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/internal/AutomaticInboxProcessor.java b/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/internal/AutomaticInboxProcessor.java index 779853194..a56d5df86 100644 --- a/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/internal/AutomaticInboxProcessor.java +++ b/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/internal/AutomaticInboxProcessor.java @@ -118,7 +118,7 @@ public class AutomaticInboxProcessor extends AbstractTypedEventSubscriber properties) { + protected void activate(@Nullable Map properties) { thingRegistry.addRegistryChangeListener(this); inbox.addInboxListener(this); @@ -126,7 +126,7 @@ public class AutomaticInboxProcessor extends AbstractTypedEventSubscriber properties) { + protected void modified(@Nullable Map properties) { if (properties != null) { Object value = properties.get(AUTO_IGNORE_CONFIG_PROPERTY); autoIgnore = value == null || !"false".equals(value.toString()); diff --git a/bundles/org.openhab.core.io.rest.auth/src/main/java/org/openhab/core/io/rest/auth/internal/AuthFilter.java b/bundles/org.openhab.core.io.rest.auth/src/main/java/org/openhab/core/io/rest/auth/internal/AuthFilter.java index 1d3389e87..1388b6923 100644 --- a/bundles/org.openhab.core.io.rest.auth/src/main/java/org/openhab/core/io/rest/auth/internal/AuthFilter.java +++ b/bundles/org.openhab.core.io.rest.auth/src/main/java/org/openhab/core/io/rest/auth/internal/AuthFilter.java @@ -87,7 +87,7 @@ public class AuthFilter implements ContainerRequestFilter { } @Modified - protected void modified(@Nullable Map properties) { + protected void modified(@Nullable Map properties) { if (properties != null) { Object value = properties.get(CONFIG_ALLOW_BASIC_AUTH); allowBasicAuth = value != null && "true".equals(value.toString()); diff --git a/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/DefaultSystemChannelTypeProvider.java b/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/DefaultSystemChannelTypeProvider.java index 422bb2249..5908b915f 100644 --- a/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/DefaultSystemChannelTypeProvider.java +++ b/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/DefaultSystemChannelTypeProvider.java @@ -284,7 +284,7 @@ public class DefaultSystemChannelTypeProvider implements ChannelTypeProvider { SYSTEM_MEDIA_ARTIST, SYSTEM_WIND_DIRECTION, SYSTEM_WIND_SPEED, SYSTEM_OUTDOOR_TEMPERATURE, SYSTEM_ATMOSPHERIC_HUMIDITY, SYSTEM_BAROMETRIC_PRESSURE); - private final Map localizedChannelTypeCache = new ConcurrentHashMap<>(); + private final Map localizedChannelTypeCache = new ConcurrentHashMap<>(); private final ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService; private final BundleResolver bundleResolver; diff --git a/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/binding/BaseDynamicCommandDescriptionProvider.java b/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/binding/BaseDynamicCommandDescriptionProvider.java index 09e3495c8..bb465cb6a 100644 --- a/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/binding/BaseDynamicCommandDescriptionProvider.java +++ b/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/binding/BaseDynamicCommandDescriptionProvider.java @@ -48,7 +48,7 @@ public abstract class BaseDynamicCommandDescriptionProvider implements DynamicCo private @NonNullByDefault({}) BundleContext bundleContext; protected @NonNullByDefault({}) ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService; - protected final Map> channelOptionsMap = new ConcurrentHashMap<>(); + protected final Map> channelOptionsMap = new ConcurrentHashMap<>(); /** * For a given channel UID, set a {@link List} of {@link CommandOption}s that should be used for the channel, diff --git a/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/binding/BaseDynamicStateDescriptionProvider.java b/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/binding/BaseDynamicStateDescriptionProvider.java index 5db2db50c..3e6919ca8 100644 --- a/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/binding/BaseDynamicStateDescriptionProvider.java +++ b/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/binding/BaseDynamicStateDescriptionProvider.java @@ -49,8 +49,8 @@ public abstract class BaseDynamicStateDescriptionProvider implements DynamicStat private @NonNullByDefault({}) BundleContext bundleContext; protected @NonNullByDefault({}) ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService; - protected final Map channelPatternMap = new ConcurrentHashMap<>(); - protected final Map> channelOptionsMap = new ConcurrentHashMap<>(); + protected final Map channelPatternMap = new ConcurrentHashMap<>(); + protected final Map> channelOptionsMap = new ConcurrentHashMap<>(); /** * For a given channel UID, set a pattern that should be used for the channel, instead of the one defined statically diff --git a/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/binding/BaseThingHandlerFactory.java b/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/binding/BaseThingHandlerFactory.java index bb4f88f21..7480a40a0 100644 --- a/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/binding/BaseThingHandlerFactory.java +++ b/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/binding/BaseThingHandlerFactory.java @@ -60,8 +60,8 @@ public abstract class BaseThingHandlerFactory implements ThingHandlerFactory { private final Logger logger = LoggerFactory.getLogger(BaseThingHandlerFactory.class); - private final Map> configStatusProviders = new ConcurrentHashMap<>(); - private final Map> firmwareUpdateHandlers = new ConcurrentHashMap<>(); + private final Map> configStatusProviders = new ConcurrentHashMap<>(); + private final Map> firmwareUpdateHandlers = new ConcurrentHashMap<>(); private final Map>> thingHandlerServices = new ConcurrentHashMap<>(); diff --git a/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/internal/AutoUpdateManager.java b/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/internal/AutoUpdateManager.java index 01043336e..42131a9c1 100644 --- a/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/internal/AutoUpdateManager.java +++ b/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/internal/AutoUpdateManager.java @@ -17,7 +17,6 @@ import java.util.List; import java.util.Map; import org.eclipse.jdt.annotation.NonNullByDefault; -import org.eclipse.jdt.annotation.Nullable; import org.openhab.core.events.EventPublisher; import org.openhab.core.items.Item; import org.openhab.core.items.Metadata; @@ -106,7 +105,7 @@ public class AutoUpdateManager { } @Activate - public AutoUpdateManager(Map configuration, + public AutoUpdateManager(Map configuration, final @Reference ChannelTypeRegistry channelTypeRegistry, // final @Reference EventPublisher eventPublisher, final @Reference ItemChannelLinkRegistry itemChannelLinkRegistry, @@ -122,7 +121,7 @@ public class AutoUpdateManager { } @Modified - protected void modified(Map configuration) { + protected void modified(Map configuration) { Object valueEnabled = configuration.get(PROPERTY_ENABLED); if (valueEnabled != null) { enabled = Boolean.parseBoolean(valueEnabled.toString()); diff --git a/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/internal/CommunicationManager.java b/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/internal/CommunicationManager.java index bf8b8e293..164b79e70 100644 --- a/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/internal/CommunicationManager.java +++ b/bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/internal/CommunicationManager.java @@ -137,8 +137,8 @@ public class CommunicationManager implements EventSubscriber, RegistryChangeList private final Set profileAdvisors = new CopyOnWriteArraySet<>(); - private final Map>> acceptedCommandTypeMap = new ConcurrentHashMap<>(); - private final Map>> acceptedStateTypeMap = new ConcurrentHashMap<>(); + private final Map>> acceptedCommandTypeMap = new ConcurrentHashMap<>(); + private final Map>> acceptedStateTypeMap = new ConcurrentHashMap<>(); @Override public Set getSubscribedEventTypes() { diff --git a/bundles/org.openhab.core/src/main/java/org/openhab/core/internal/common/SafeCallManagerImpl.java b/bundles/org.openhab.core/src/main/java/org/openhab/core/internal/common/SafeCallManagerImpl.java index 62bd710b3..79be21a73 100644 --- a/bundles/org.openhab.core/src/main/java/org/openhab/core/internal/common/SafeCallManagerImpl.java +++ b/bundles/org.openhab.core/src/main/java/org/openhab/core/internal/common/SafeCallManagerImpl.java @@ -38,9 +38,9 @@ public class SafeCallManagerImpl implements SafeCallManager { private final Logger logger = LoggerFactory.getLogger(SafeCallManagerImpl.class); - private final Map> queues = new HashMap<>(); - private final Map activeIdentifiers = new HashMap<>(); - private final Map activeAsyncInvocations = new HashMap<>(); + private final Map> queues = new HashMap<>(); + private final Map activeIdentifiers = new HashMap<>(); + private final Map activeAsyncInvocations = new HashMap<>(); private final ScheduledExecutorService watcher; private final ExecutorService scheduler; diff --git a/bundles/org.openhab.core/src/main/java/org/openhab/core/service/WatchQueueReader.java b/bundles/org.openhab.core/src/main/java/org/openhab/core/service/WatchQueueReader.java index e9352e56c..00bc5a313 100644 --- a/bundles/org.openhab.core/src/main/java/org/openhab/core/service/WatchQueueReader.java +++ b/bundles/org.openhab.core/src/main/java/org/openhab/core/service/WatchQueueReader.java @@ -43,7 +43,6 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; -import org.eclipse.jdt.annotation.Nullable; import org.openhab.core.common.ThreadPoolManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -68,7 +67,7 @@ public class WatchQueueReader implements Runnable { private final Map registeredKeys = new HashMap<>(); private final Map keyToService = new HashMap<>(); private final Map> hashes = new HashMap<>(); - private final Map>> futures = new ConcurrentHashMap<>(); + private final Map>> futures = new ConcurrentHashMap<>(); private Thread qr; @@ -192,7 +191,7 @@ public class WatchQueueReader implements Runnable { keyToService.remove(key); registeredKeys.remove(key); hashes.remove(service); - Map> keyFutures = futures.remove(key); + Map> keyFutures = futures.remove(key); if (keyFutures != null) { keyFutures.values().forEach(future -> future.cancel(true)); } @@ -259,7 +258,7 @@ public class WatchQueueReader implements Runnable { toCancel.cancel(); } forgetChecksum(service, resolvedPath); - Map> keyFutures = futures.get(key); + Map> keyFutures = futures.get(key); if (keyFutures != null) { ScheduledFuture future = keyFutures.remove(resolvedPath); if (future != null) { @@ -403,8 +402,8 @@ public class WatchQueueReader implements Runnable { } } - private Map> getKeyFutures(WatchKey key) { - Map> keyFutures = futures.get(key); + private Map> getKeyFutures(WatchKey key) { + Map> keyFutures = futures.get(key); if (keyFutures == null) { keyFutures = new ConcurrentHashMap<>(); futures.put(key, keyFutures); @@ -413,12 +412,12 @@ public class WatchQueueReader implements Runnable { } private ScheduledFuture removeScheduledJob(WatchKey key, Path resolvedPath) { - Map> keyFutures = getKeyFutures(key); + Map> keyFutures = getKeyFutures(key); return keyFutures.remove(resolvedPath); } private void rememberScheduledJob(WatchKey key, Path resolvedPath, ScheduledFuture future) { - Map> keyFutures = getKeyFutures(key); + Map> keyFutures = getKeyFutures(key); keyFutures.put(resolvedPath, future); } }