You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by li...@apache.org on 2019/11/18 14:54:54 UTC
[dubbo] branch master updated: Clean up CommandHelper class and add
its private ctor (#5265)
This is an automated email from the ASF dual-hosted git repository.
liujun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/master by this push:
new 3f1307d Clean up CommandHelper class and add its private ctor (#5265)
3f1307d is described below
commit 3f1307da013987c40439eb60dbc4fb01c8a601e8
Author: James Xu <ja...@gmail.com>
AuthorDate: Mon Nov 18 22:54:43 2019 +0800
Clean up CommandHelper class and add its private ctor (#5265)
---
.../org/apache/dubbo/qos/command/util/CommandHelper.java | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/command/util/CommandHelper.java b/dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/command/util/CommandHelper.java
index 46da57b..6300c81 100644
--- a/dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/command/util/CommandHelper.java
+++ b/dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/command/util/CommandHelper.java
@@ -24,6 +24,10 @@ import java.util.List;
import java.util.Set;
public class CommandHelper {
+
+ private CommandHelper() {
+ }
+
public static boolean hasCommand(String commandName) {
BaseCommand command = null;
@@ -37,7 +41,7 @@ public class CommandHelper {
}
- public static List<Class<?>> getAllCommandClass(){
+ public static List<Class<?>> getAllCommandClass() {
final Set<String> commandList = ExtensionLoader.getExtensionLoader(BaseCommand.class).getSupportedExtensions();
final List<Class<?>> classes = new ArrayList<Class<?>>();
@@ -50,10 +54,10 @@ public class CommandHelper {
}
- public static Class<?> getCommandClass(String commandName){
- if (hasCommand(commandName)){
+ public static Class<?> getCommandClass(String commandName) {
+ if (hasCommand(commandName)) {
return ExtensionLoader.getExtensionLoader(BaseCommand.class).getExtension(commandName).getClass();
- }else {
+ } else {
return null;
}
}