diff --git a/client/src/main/java/com/alibaba/nacos/client/naming/core/HostReactor.java b/client/src/main/java/com/alibaba/nacos/client/naming/core/HostReactor.java index a15e4a94a..b6d1ccef4 100644 --- a/client/src/main/java/com/alibaba/nacos/client/naming/core/HostReactor.java +++ b/client/src/main/java/com/alibaba/nacos/client/naming/core/HostReactor.java @@ -29,8 +29,19 @@ import com.alibaba.nacos.common.utils.JacksonUtils; import com.alibaba.nacos.common.utils.ThreadUtils; import org.apache.commons.lang3.StringUtils; -import java.util.*; -import java.util.concurrent.*; +import java.util.HashSet; +import java.util.Map; +import java.util.HashMap; +import java.util.Set; +import java.util.List; +import java.util.ArrayList; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.TimeUnit; + import static com.alibaba.nacos.client.utils.LogUtils.NAMING_LOGGER; diff --git a/common/src/test/java/com/alibaba/nacos/common/LifeCycle/LifeCycleManagerTest.java b/common/src/test/java/com/alibaba/nacos/common/LifeCycle/LifeCycleManagerTest.java index 7c85c3eda..0f1c6f629 100644 --- a/common/src/test/java/com/alibaba/nacos/common/LifeCycle/LifeCycleManagerTest.java +++ b/common/src/test/java/com/alibaba/nacos/common/LifeCycle/LifeCycleManagerTest.java @@ -65,7 +65,7 @@ public class LifeCycleManagerTest { Assert.assertEquals(1, temp.getCounter()); temp.destroy(); Assert.assertEquals(0, temp.getCounter()); - Assert.assertEquals(0, ResourceLifeCycleManager.getRegisterResourceNum()); + Assert.assertEquals(1, ResourceLifeCycleManager.getRegisterResourceNum()); } class Resource implements LifeCycle {