mirror of
https://github.com/danieldemus/openhab-core.git
synced 2026-07-29 12:34:22 +02:00
fix null type in model.thing generic item channel link provider (#1864)
required '@NonNull Collection<?>' but this expression has type '@Nullable Set<@NonNull String>' Signed-off-by: Markus Rathgeb <maggu2810@gmail.com>
This commit is contained in:
+13
-12
@@ -16,6 +16,7 @@ import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -119,21 +120,21 @@ public class GenericItemChannelLinkProvider extends AbstractProvider<ItemChannel
|
||||
|
||||
@Override
|
||||
public void stopConfigurationUpdate(String context) {
|
||||
if (previousItemNames != null) {
|
||||
for (String itemName : previousItemNames) {
|
||||
// we remove all binding configurations that were not processed
|
||||
Set<ItemChannelLink> links = itemChannelLinkMap.remove(itemName);
|
||||
if (links != null) {
|
||||
for (ItemChannelLink removedItemChannelLink : links) {
|
||||
notifyListenersAboutRemovedElement(removedItemChannelLink);
|
||||
}
|
||||
final Set<String> previousItemNames = this.previousItemNames;
|
||||
this.previousItemNames = null;
|
||||
if (previousItemNames == null) {
|
||||
return;
|
||||
}
|
||||
for (String itemName : previousItemNames) {
|
||||
// we remove all binding configurations that were not processed
|
||||
Set<ItemChannelLink> links = itemChannelLinkMap.remove(itemName);
|
||||
if (links != null) {
|
||||
for (ItemChannelLink removedItemChannelLink : links) {
|
||||
notifyListenersAboutRemovedElement(removedItemChannelLink);
|
||||
}
|
||||
}
|
||||
if (contextMap.get(context) != null) {
|
||||
contextMap.get(context).removeAll(previousItemNames);
|
||||
}
|
||||
previousItemNames = null;
|
||||
}
|
||||
Optional.ofNullable(contextMap.get(context)).ifPresent(ctx -> ctx.removeAll(previousItemNames));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user