Skip to content

Commit

Permalink
Merge apache#1740 manually, fix typo.
Browse files Browse the repository at this point in the history
  • Loading branch information
chickenlj committed Jun 1, 2018
1 parent 6d55953 commit 2e09f21
Showing 1 changed file with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -119,13 +119,7 @@ public int compareTo(Configurator o) {
if (ipCompare == 0) {//host is the same, sort by priority
int 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 < j ? -1 : (i == j ? 0 : 1);
} else {
return ipCompare;
}
Expand Down

0 comments on commit 2e09f21

Please sign in to comment.