From acc4e337d23365d36f8065e40c8b14b541342890 Mon Sep 17 00:00:00 2001 From: FrankBian Date: Sat, 29 Dec 2018 17:21:10 +0800 Subject: [PATCH] clean code,remove repeat code --- .../com/alibaba/nacos/api/config/ConfigFactory.java | 11 ++--------- .../nacos/api/config/listener/AbstractListener.java | 2 +- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/api/src/main/java/com/alibaba/nacos/api/config/ConfigFactory.java b/api/src/main/java/com/alibaba/nacos/api/config/ConfigFactory.java index 1e6e9a9db..4fd1078d6 100644 --- a/api/src/main/java/com/alibaba/nacos/api/config/ConfigFactory.java +++ b/api/src/main/java/com/alibaba/nacos/api/config/ConfigFactory.java @@ -49,21 +49,14 @@ public class ConfigFactory { /** * Create Config * - * @param ServerAddr serverlist + * @param serverAddr serverlist * @return Config * @throws NacosException Exception */ public static ConfigService createConfigService(String serverAddr) throws NacosException { Properties properties = new Properties(); properties.put(PropertyKeyConst.SERVER_ADDR, serverAddr); - try { - Class driverImplClass = Class.forName("com.alibaba.nacos.client.config.NacosConfigService"); - Constructor constructor = driverImplClass.getConstructor(Properties.class); - ConfigService vendorImpl = (ConfigService)constructor.newInstance(properties); - return vendorImpl; - } catch (Throwable e) { - throw new NacosException(-400, e.getMessage()); - } + return createConfigService(properties); } } diff --git a/api/src/main/java/com/alibaba/nacos/api/config/listener/AbstractListener.java b/api/src/main/java/com/alibaba/nacos/api/config/listener/AbstractListener.java index 645f6545c..ea253eda5 100644 --- a/api/src/main/java/com/alibaba/nacos/api/config/listener/AbstractListener.java +++ b/api/src/main/java/com/alibaba/nacos/api/config/listener/AbstractListener.java @@ -18,7 +18,7 @@ package com.alibaba.nacos.api.config.listener; import java.util.concurrent.Executor; /** - * Listner Adapter,use default notify thread + * Listener Adapter,use default notify thread * * @author water.lyl */