diff --git a/common/src/main/java/com/alibaba/nacos/common/notify/DefaultSharePublisher.java b/common/src/main/java/com/alibaba/nacos/common/notify/DefaultSharePublisher.java index a2fa996d1..fd1c973c3 100644 --- a/common/src/main/java/com/alibaba/nacos/common/notify/DefaultSharePublisher.java +++ b/common/src/main/java/com/alibaba/nacos/common/notify/DefaultSharePublisher.java @@ -79,7 +79,7 @@ public class DefaultSharePublisher extends DefaultPublisher { try { Set sets = subMappings.get(subSlowEventType); - if (sets != null && sets.contains(subscriber)) { + if (sets != null) { sets.remove(subscriber); } } finally { diff --git a/common/src/main/java/com/alibaba/nacos/common/utils/MapUtils.java b/common/src/main/java/com/alibaba/nacos/common/utils/MapUtils.java index 7febf7eda..19d8d157f 100644 --- a/common/src/main/java/com/alibaba/nacos/common/utils/MapUtils.java +++ b/common/src/main/java/com/alibaba/nacos/common/utils/MapUtils.java @@ -131,7 +131,7 @@ public class MapUtils { * * @param target target Map data. * @param key map key. - * @param mappingFunction funtion which is need to be executed. + * @param mappingFunction function which is need to be executed. * @param param1 function's parameter value1. * @param param2 function's parameter value1. * @return @@ -140,10 +140,11 @@ public class MapUtils { public static Object computeIfAbsent(Map target, Object key, BiFunction mappingFunction, Object param1, Object param2) { + Objects.requireNonNull(target, "target"); Objects.requireNonNull(key, "key"); - Objects.requireNonNull(key, "mappingFunction"); - Objects.requireNonNull(key, "param1"); - Objects.requireNonNull(key, "param2"); + Objects.requireNonNull(mappingFunction, "mappingFunction"); + Objects.requireNonNull(param1, "param1"); + Objects.requireNonNull(param2, "param2"); Object val = target.get(key); if (val == null) {