Remove Map null annotation workarounds (#8916)
These workarounds to prevent false positives can be removed now the EEAs allow for proper null analysis. Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
@@ -60,7 +60,7 @@ public class NestHandlerFactory extends BaseThingHandlerFactory {
|
||||
|
||||
private final ClientBuilder clientBuilder;
|
||||
private final SseEventSourceFactory eventSourceFactory;
|
||||
private final Map<ThingUID, @Nullable ServiceRegistration<?>> discoveryService = new HashMap<>();
|
||||
private final Map<ThingUID, ServiceRegistration<?>> discoveryService = new HashMap<>();
|
||||
|
||||
@Activate
|
||||
public NestHandlerFactory(@Reference ClientBuilder clientBuilder,
|
||||
|
||||
@@ -35,7 +35,7 @@ import org.openhab.binding.nest.internal.listener.NestThingDataListener;
|
||||
public class NestCompositeUpdateHandler {
|
||||
|
||||
private final Supplier<Set<String>> presentNestIdsSupplier;
|
||||
private final Map<Class<?>, @Nullable NestUpdateHandler<?>> updateHandlersMap = new ConcurrentHashMap<>();
|
||||
private final Map<Class<?>, NestUpdateHandler<?>> updateHandlersMap = new ConcurrentHashMap<>();
|
||||
|
||||
public NestCompositeUpdateHandler(Supplier<Set<String>> presentNestIdsSupplier) {
|
||||
this.presentNestIdsSupplier = presentNestIdsSupplier;
|
||||
@@ -104,9 +104,7 @@ public class NestCompositeUpdateHandler {
|
||||
Set<String> missingNestIds = findMissingNestIds(updates);
|
||||
if (!missingNestIds.isEmpty()) {
|
||||
updateHandlersMap.values().forEach(handler -> {
|
||||
if (handler != null) {
|
||||
handler.handleMissingNestIds(missingNestIds);
|
||||
}
|
||||
handler.handleMissingNestIds(missingNestIds);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -121,9 +119,7 @@ public class NestCompositeUpdateHandler {
|
||||
|
||||
public void resendLastUpdates() {
|
||||
updateHandlersMap.values().forEach(handler -> {
|
||||
if (handler != null) {
|
||||
handler.resendLastUpdates();
|
||||
}
|
||||
handler.resendLastUpdates();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,8 +39,8 @@ public class NestUpdateHandler<T> {
|
||||
*/
|
||||
private static final String ANY_ID = "*";
|
||||
|
||||
private final Map<String, @Nullable T> lastUpdates = new ConcurrentHashMap<>();
|
||||
private final Map<String, @Nullable Set<NestThingDataListener<T>>> listenersMap = new ConcurrentHashMap<>();
|
||||
private final Map<String, T> lastUpdates = new ConcurrentHashMap<>();
|
||||
private final Map<String, Set<NestThingDataListener<T>>> listenersMap = new ConcurrentHashMap<>();
|
||||
|
||||
public boolean addListener(NestThingDataListener<T> listener) {
|
||||
return addListener(ANY_ID, listener);
|
||||
|
||||
Reference in New Issue
Block a user