chickenlj closed pull request #1740: some minor adjustment
URL: https://github.com/apache/incubator-dubbo/pull/1740
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/dubbo-cluster/src/main/java/com/alibaba/dubbo/rpc/cluster/configurator/AbstractConfigurator.java
 
b/dubbo-cluster/src/main/java/com/alibaba/dubbo/rpc/cluster/configurator/AbstractConfigurator.java
index 32c6c9ec30..dd25a0ac4b 100644
--- 
a/dubbo-cluster/src/main/java/com/alibaba/dubbo/rpc/cluster/configurator/AbstractConfigurator.java
+++ 
b/dubbo-cluster/src/main/java/com/alibaba/dubbo/rpc/cluster/configurator/AbstractConfigurator.java
@@ -79,23 +79,23 @@ private URL configureIfMatch(String host, URL url) {
             String currentApplication = 
url.getParameter(Constants.APPLICATION_KEY, url.getUsername());
             if (configApplication == null || 
Constants.ANY_VALUE.equals(configApplication)
                     || configApplication.equals(currentApplication)) {
-                Set<String> condtionKeys = new HashSet<String>();
-                condtionKeys.add(Constants.CATEGORY_KEY);
-                condtionKeys.add(Constants.CHECK_KEY);
-                condtionKeys.add(Constants.DYNAMIC_KEY);
-                condtionKeys.add(Constants.ENABLED_KEY);
+                Set<String> conditionKeys = new HashSet<String>();
+                conditionKeys.add(Constants.CATEGORY_KEY);
+                conditionKeys.add(Constants.CHECK_KEY);
+                conditionKeys.add(Constants.DYNAMIC_KEY);
+                conditionKeys.add(Constants.ENABLED_KEY);
                 for (Map.Entry<String, String> entry : 
configuratorUrl.getParameters().entrySet()) {
                     String key = entry.getKey();
                     String value = entry.getValue();
                     if (key.startsWith("~") || 
Constants.APPLICATION_KEY.equals(key) || Constants.SIDE_KEY.equals(key)) {
-                        condtionKeys.add(key);
+                        conditionKeys.add(key);
                         if (value != null && !Constants.ANY_VALUE.equals(value)
                                 && 
!value.equals(url.getParameter(key.startsWith("~") ? key.substring(1) : key))) {
                             return url;
                         }
                     }
                 }
-                return doConfigure(url, 
configuratorUrl.removeParameters(condtionKeys));
+                return doConfigure(url, 
configuratorUrl.removeParameters(conditionKeys));
             }
         }
         return url;
@@ -117,15 +117,9 @@ public int compareTo(Configurator o) {
 
         int ipCompare = getUrl().getHost().compareTo(o.getUrl().getHost());
         if (ipCompare == 0) {//host is the same, sort by priority
-            int i = getUrl().getParameter(Constants.PRIORITY_KEY, 0),
+            Integer i = getUrl().getParameter(Constants.PRIORITY_KEY, 0),
                     j = o.getUrl().getParameter(Constants.PRIORITY_KEY, 0);
-            if (i < j) {
-                return -1;
-            } else if (i > j) {
-                return 1;
-            } else {
-                return 0;
-            }
+            return i.compareTo(j);
         } else {
             return ipCompare;
         }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to