Skip to content

Commit 8079b08

Browse files
beiwei30chickenlj
authored andcommitted
Merge pull request apache#1716, unit test for AbstractConfigTest.
1 parent a17dc54 commit 8079b08

File tree

19 files changed

+1193
-8
lines changed

19 files changed

+1193
-8
lines changed

dubbo-common/src/main/java/com/alibaba/dubbo/common/utils/ConfigUtils.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,7 @@ public static Properties getProperties() {
158158
}
159159

160160
public static void setProperties(Properties properties) {
161-
if (properties != null) {
162-
PROPERTIES = properties;
163-
}
161+
PROPERTIES = properties;
164162
}
165163

166164
public static void addProperties(Properties properties) {

dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/AbstractConfig.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,11 @@ && isPrimitive(method.getReturnType())) {
214214
str = URL.encode(str);
215215
}
216216
if (parameter != null && parameter.append()) {
217-
String pre = (String) parameters.get(Constants.DEFAULT_KEY + "." + key);
217+
String pre = parameters.get(Constants.DEFAULT_KEY + "." + key);
218218
if (pre != null && pre.length() > 0) {
219219
str = pre + "," + str;
220220
}
221-
pre = (String) parameters.get(key);
221+
pre = parameters.get(key);
222222
if (pre != null && pre.length() > 0) {
223223
str = pre + "," + str;
224224
}
@@ -387,7 +387,6 @@ protected static void checkParameterName(Map<String, String> parameters) {
387387
return;
388388
}
389389
for (Map.Entry<String, String> entry : parameters.entrySet()) {
390-
//change by tony.chenl parameter value maybe has colon.for example napoli address
391390
checkNameHasSymbol(entry.getKey(), entry.getValue());
392391
}
393392
}
@@ -402,7 +401,8 @@ protected static void checkProperty(String property, String value, int maxlength
402401
if (pattern != null) {
403402
Matcher matcher = pattern.matcher(value);
404403
if (!matcher.matches()) {
405-
throw new IllegalStateException("Invalid " + property + "=\"" + value + "\" contain illegal charactor, only digit, letter, '-', '_' and '.' is legal.");
404+
throw new IllegalStateException("Invalid " + property + "=\"" + value + "\" contains illegal " +
405+
"character, only digit, letter, '-', '_' or '.' is legal.");
406406
}
407407
}
408408
}

dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/AbstractInterfaceConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ public String getStub() {
360360
}
361361

362362
public void setStub(Boolean stub) {
363-
if (local == null) {
363+
if (stub == null) {
364364
setStub((String) null);
365365
} else {
366366
setStub(String.valueOf(stub));

0 commit comments

Comments
 (0)