From 98e6a7fa9d8f24080963c084f7fdf1842319c485 Mon Sep 17 00:00:00 2001 From: XS Date: Fri, 8 Sep 2023 10:15:52 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20issue:#1230=20Checkstyle=20Unuse?= =?UTF-8?q?dImports=20remove?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapping/impl/NacosServiceMapping.java | 15 +++++---------- .../admin/registry/nacos/NacosOpenapiUtil.java | 5 +---- .../admin/service/AdminProviderFirstParams.java | 5 ----- .../dubbo/admin/service/RegistryServerSync.java | 3 +-- .../admin/service/impl/ConsumerServiceImpl.java | 5 +---- 5 files changed, 8 insertions(+), 25 deletions(-) diff --git a/dubbo-admin-server/src/main/java/org/apache/dubbo/admin/registry/mapping/impl/NacosServiceMapping.java b/dubbo-admin-server/src/main/java/org/apache/dubbo/admin/registry/mapping/impl/NacosServiceMapping.java index 2d40f6748..0a2f1aed5 100644 --- a/dubbo-admin-server/src/main/java/org/apache/dubbo/admin/registry/mapping/impl/NacosServiceMapping.java +++ b/dubbo-admin-server/src/main/java/org/apache/dubbo/admin/registry/mapping/impl/NacosServiceMapping.java @@ -18,6 +18,11 @@ package org.apache.dubbo.admin.registry.mapping.impl; import org.apache.dubbo.admin.registry.mapping.ServiceMapping; + +import com.alibaba.nacos.api.common.Constants; +import com.alibaba.nacos.api.exception.NacosException; +import com.alibaba.nacos.api.naming.pojo.ListView; +import com.google.common.collect.Sets; import org.apache.dubbo.common.URL; import org.apache.dubbo.common.logger.Logger; import org.apache.dubbo.common.logger.LoggerFactory; @@ -25,19 +30,9 @@ import org.apache.dubbo.common.utils.StringUtils; import org.apache.dubbo.metadata.MappingChangedEvent; import org.apache.dubbo.metadata.MappingListener; -import org.apache.dubbo.registry.client.ServiceInstance; import org.apache.dubbo.registry.nacos.NacosNamingServiceWrapper; import org.apache.dubbo.registry.nacos.util.NacosNamingServiceUtils; -import com.alibaba.nacos.api.common.Constants; -import com.alibaba.nacos.api.exception.NacosException; -import com.alibaba.nacos.api.naming.pojo.ListView; -import com.google.common.collect.Sets; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.HttpURLConnection; import java.util.Arrays; import java.util.HashSet; import java.util.List; diff --git a/dubbo-admin-server/src/main/java/org/apache/dubbo/admin/registry/nacos/NacosOpenapiUtil.java b/dubbo-admin-server/src/main/java/org/apache/dubbo/admin/registry/nacos/NacosOpenapiUtil.java index 4e02bcc77..cacf4ab32 100644 --- a/dubbo-admin-server/src/main/java/org/apache/dubbo/admin/registry/nacos/NacosOpenapiUtil.java +++ b/dubbo-admin-server/src/main/java/org/apache/dubbo/admin/registry/nacos/NacosOpenapiUtil.java @@ -16,15 +16,12 @@ */ package org.apache.dubbo.admin.registry.nacos; -import org.apache.dubbo.admin.controller.AccessesController; +import com.alibaba.fastjson2.JSON; import org.apache.dubbo.common.URL; import org.apache.dubbo.common.logger.Logger; import org.apache.dubbo.common.logger.LoggerFactory; import org.apache.dubbo.common.utils.StringUtils; -import com.alibaba.fastjson2.JSON; -import net.bytebuddy.implementation.bytecode.Throw; - import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; diff --git a/dubbo-admin-server/src/main/java/org/apache/dubbo/admin/service/AdminProviderFirstParams.java b/dubbo-admin-server/src/main/java/org/apache/dubbo/admin/service/AdminProviderFirstParams.java index 86a4aa2b5..4f42a7d06 100644 --- a/dubbo-admin-server/src/main/java/org/apache/dubbo/admin/service/AdminProviderFirstParams.java +++ b/dubbo-admin-server/src/main/java/org/apache/dubbo/admin/service/AdminProviderFirstParams.java @@ -24,12 +24,7 @@ import java.util.Set; import static org.apache.dubbo.common.constants.CommonConstants.APPLICATION_KEY; -import static org.apache.dubbo.common.constants.CommonConstants.DUBBO_VERSION_KEY; import static org.apache.dubbo.common.constants.CommonConstants.INTERFACE_KEY; -import static org.apache.dubbo.common.constants.CommonConstants.METHODS_KEY; -import static org.apache.dubbo.common.constants.CommonConstants.RELEASE_KEY; -import static org.apache.dubbo.common.constants.CommonConstants.TAG_KEY; -import static org.apache.dubbo.common.constants.CommonConstants.TIMESTAMP_KEY; public class AdminProviderFirstParams implements ProviderFirstParams { private static final Set PARAMS = Collections.unmodifiableSet(new HashSet() {{ diff --git a/dubbo-admin-server/src/main/java/org/apache/dubbo/admin/service/RegistryServerSync.java b/dubbo-admin-server/src/main/java/org/apache/dubbo/admin/service/RegistryServerSync.java index 1e94533eb..72a10dc54 100644 --- a/dubbo-admin-server/src/main/java/org/apache/dubbo/admin/service/RegistryServerSync.java +++ b/dubbo-admin-server/src/main/java/org/apache/dubbo/admin/service/RegistryServerSync.java @@ -20,6 +20,7 @@ import org.apache.dubbo.admin.common.util.Constants; import org.apache.dubbo.admin.common.util.Tool; import org.apache.dubbo.admin.service.impl.InterfaceRegistryCache; + import org.apache.dubbo.common.BaseServiceMetadata; import org.apache.dubbo.common.URL; import org.apache.dubbo.common.logger.Logger; @@ -29,8 +30,6 @@ import org.apache.dubbo.registry.NotifyListener; import org.apache.dubbo.registry.Registry; import org.apache.dubbo.registry.client.InstanceAddressURL; -import org.apache.dubbo.registry.nacos.NacosRegistry; - import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.context.event.ApplicationReadyEvent; diff --git a/dubbo-admin-server/src/main/java/org/apache/dubbo/admin/service/impl/ConsumerServiceImpl.java b/dubbo-admin-server/src/main/java/org/apache/dubbo/admin/service/impl/ConsumerServiceImpl.java index c6163baf5..c45e809ce 100644 --- a/dubbo-admin-server/src/main/java/org/apache/dubbo/admin/service/impl/ConsumerServiceImpl.java +++ b/dubbo-admin-server/src/main/java/org/apache/dubbo/admin/service/impl/ConsumerServiceImpl.java @@ -23,14 +23,11 @@ import org.apache.dubbo.admin.registry.nacos.NacosData; import org.apache.dubbo.admin.registry.nacos.NacosOpenapiUtil; import org.apache.dubbo.admin.service.ConsumerService; + import org.apache.dubbo.common.URL; -import org.apache.dubbo.common.utils.NetUtils; import org.apache.dubbo.common.utils.StringUtils; import org.apache.dubbo.metadata.report.identifier.MetadataIdentifier; import org.apache.dubbo.registry.Registry; -import org.apache.dubbo.registry.client.DefaultServiceInstance; -import org.apache.dubbo.registry.nacos.NacosRegistry; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component;