@@ -79,23 +79,23 @@ private URL configureIfMatch(String host, URL url) {
79
79
String currentApplication = url .getParameter (Constants .APPLICATION_KEY , url .getUsername ());
80
80
if (configApplication == null || Constants .ANY_VALUE .equals (configApplication )
81
81
|| configApplication .equals (currentApplication )) {
82
- Set <String > condtionKeys = new HashSet <String >();
83
- condtionKeys .add (Constants .CATEGORY_KEY );
84
- condtionKeys .add (Constants .CHECK_KEY );
85
- condtionKeys .add (Constants .DYNAMIC_KEY );
86
- condtionKeys .add (Constants .ENABLED_KEY );
82
+ Set <String > conditionKeys = new HashSet <String >();
83
+ conditionKeys .add (Constants .CATEGORY_KEY );
84
+ conditionKeys .add (Constants .CHECK_KEY );
85
+ conditionKeys .add (Constants .DYNAMIC_KEY );
86
+ conditionKeys .add (Constants .ENABLED_KEY );
87
87
for (Map .Entry <String , String > entry : configuratorUrl .getParameters ().entrySet ()) {
88
88
String key = entry .getKey ();
89
89
String value = entry .getValue ();
90
90
if (key .startsWith ("~" ) || Constants .APPLICATION_KEY .equals (key ) || Constants .SIDE_KEY .equals (key )) {
91
- condtionKeys .add (key );
91
+ conditionKeys .add (key );
92
92
if (value != null && !Constants .ANY_VALUE .equals (value )
93
93
&& !value .equals (url .getParameter (key .startsWith ("~" ) ? key .substring (1 ) : key ))) {
94
94
return url ;
95
95
}
96
96
}
97
97
}
98
- return doConfigure (url , configuratorUrl .removeParameters (condtionKeys ));
98
+ return doConfigure (url , configuratorUrl .removeParameters (conditionKeys ));
99
99
}
100
100
}
101
101
return url ;
@@ -119,13 +119,7 @@ public int compareTo(Configurator o) {
119
119
if (ipCompare == 0 ) {//host is the same, sort by priority
120
120
int i = getUrl ().getParameter (Constants .PRIORITY_KEY , 0 ),
121
121
j = o .getUrl ().getParameter (Constants .PRIORITY_KEY , 0 );
122
- if (i < j ) {
123
- return -1 ;
124
- } else if (i > j ) {
125
- return 1 ;
126
- } else {
127
- return 0 ;
128
- }
122
+ return i < j ? -1 : (i == j ? 0 : 1 );
129
123
} else {
130
124
return ipCompare ;
131
125
}
0 commit comments