ing
This commit is contained in:
parent
2716b28c1d
commit
48490696a4
|
@ -52,16 +52,17 @@ public class JSONRPCClientNotificationCodec implements RPCClientNotificationCode
|
||||||
Type paramType = paramTypes[i];
|
Type paramType = paramTypes[i];
|
||||||
String param = this.notification.params.get(i);
|
String param = this.notification.params.get(i);
|
||||||
|
|
||||||
|
try {
|
||||||
JavaType targetType = objectMapper.getTypeFactory().constructType(paramType);
|
JavaType targetType = objectMapper.getTypeFactory().constructType(paramType);
|
||||||
if (!Primitives.isPrimitive(paramType) && !paramType.getTypeName().equals(String.class.getName())) {
|
if (!Primitives.isPrimitive(paramType) && !paramType.getTypeName().equals(String.class.getName())) {
|
||||||
try {
|
|
||||||
result[i] = objectMapper.readValue(param, targetType);
|
result[i] = objectMapper.readValue(param, targetType);
|
||||||
|
} else {
|
||||||
|
result[i] = objectMapper.convertValue(param, targetType);
|
||||||
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new IllegalArgumentException();
|
throw new IllegalArgumentException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result[i] = objectMapper.convertValue(param, targetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user