Skip to content

Commit de204cf

Browse files
zhaoyuguangralf0131
authored andcommitted
Optimize code: remove unnecessary judgment code. (#3196)
1 parent e1f4466 commit de204cf

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

dubbo-common/src/main/java/org/apache/dubbo/common/utils/CompatibleTypeUtils.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,10 @@ public static Object compatibleTypeConvert(Object value, Class<?> type) {
104104
// Process string to char array for generic invoke
105105
// See
106106
// - https://github.com/apache/incubator-dubbo/issues/2003
107-
if (string == null) {
108-
return null;
109-
}
110-
else {
111-
int len = string.length();
112-
char[] chars = new char[len];
113-
string.getChars(0, len, chars, 0);
114-
return chars;
115-
}
107+
int len = string.length();
108+
char[] chars = new char[len];
109+
string.getChars(0, len, chars, 0);
110+
return chars;
116111
}
117112
} else if (value instanceof Number) {
118113
Number number = (Number) value;

0 commit comments

Comments
 (0)