xukeyu-1 commented on code in PR #11573:
URL: https://github.com/apache/dubbo/pull/11573#discussion_r2986764794
##########
dubbo-serialization/dubbo-serialization-hessian2/src/main/java/org/apache/dubbo/common/serialize/hessian2/Hessian2SerializerFactory.java:
##########
@@ -55,9 +61,15 @@ protected Serializer getDefaultSerializer(Class cl) {
@Override
protected Deserializer getDefaultDeserializer(Class cl) {
+ try {
+ // pre-check if class is allow
+ defaultSerializeClassChecker.loadClass(getClassLoader(),
cl.getName());
+ } catch (ClassNotFoundException e) {
+ // ignore
+ }
+
if (!Serializable.class.isAssignableFrom(cl)
- && !isAllowNonSerializable()
- && !defaultSerializeClassChecker.isCheckSerializable()) {
+ && (!isAllowNonSerializable() ||
!defaultSerializeClassChecker.isCheckSerializable())) {
Review Comment:
!defaultSerializeClassChecker.isCheckSerializable()这个判断是不是多了个"!",导致即使配了-Ddubbo.hessian.allowNonSerializable=true和dubbo.application.check-serializable=false,用hessian2的序列化方式实体类如果不实现序列化接口也会报错
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]