This commit is contained in:
crusader 2018-05-04 19:00:02 +09:00
parent 2716b28c1d
commit 48490696a4

View File

@ -52,15 +52,16 @@ 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);
JavaType targetType = objectMapper.getTypeFactory().constructType(paramType); try {
if (!Primitives.isPrimitive(paramType) && !paramType.getTypeName().equals(String.class.getName())) { JavaType targetType = objectMapper.getTypeFactory().constructType(paramType);
try { if (!Primitives.isPrimitive(paramType) && !paramType.getTypeName().equals(String.class.getName())) {
result[i] = objectMapper.readValue(param, targetType); result[i] = objectMapper.readValue(param, targetType);
} catch (IOException e) { } else {
throw new IllegalArgumentException(); result[i] = objectMapper.convertValue(param, targetType);
} }
} catch (IOException e) {
throw new IllegalArgumentException();
} }
result[i] = objectMapper.convertValue(param, targetType);
} }
return result; return result;