You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/12/24 16:11:13 UTC
[GitHub] [dubbo] tianshuang commented on issue #9489: Optimize argument decode exception handling.
tianshuang commented on issue #9489:
URL: https://github.com/apache/dubbo/issues/9489#issuecomment-1000888615
[dubbo-hessian-lite/JavaDeserializer.java at master · apache/dubbo-hessian-lite · GitHub](https://github.com/apache/dubbo-hessian-lite/blob/master/src/main/java/com/alibaba/com/caucho/hessian/io/JavaDeserializer.java#L137):
```java
/**
* Creates a map of the classes fields.
*/
protected static Object getParamArg(Class cl) {
if (!cl.isPrimitive())
return null;
else if (boolean.class.equals(cl))
return Boolean.FALSE;
else if (byte.class.equals(cl))
return new Byte((byte) 0);
else if (short.class.equals(cl))
return new Short((short) 0);
else if (char.class.equals(cl))
return new Character((char) 0);
else if (int.class.equals(cl))
return Integer.valueOf(0);
else if (long.class.equals(cl))
return Long.valueOf(0);
else if (float.class.equals(cl))
return Float.valueOf(0);
else if (double.class.equals(cl))
return Double.valueOf(0);
else
throw new UnsupportedOperationException();
}
```
During Hessian deserialization, the parameter of the non-primitive type in the constructor will be initialized to null. If the parameter is used in the constructor, the relevant exception will be triggered during deserialization.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org