zrlw commented on issue #15750: URL: https://github.com/apache/dubbo/issues/15750#issuecomment-3483652199
> UnsafeDeserializer constructs objects via allocateInstance; in certain scenarios, the deserialized object ends up with obj.all = null rather than the default obj.all = "all". could you provide an unit test, i can't reproduce that you said with such codes based on SerializeTestBase of ```dubbo-hessian-lite``` (https://github.com/apache/dubbo-hessian-lite/blob/master/java-8-test/src/test/java/com/alibaba/com/caucho/hessian/io/base/SerializeTestBase.java) : ``` import com.alibaba.com.caucho.hessian.io.base.SerializeTestBase; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.EnabledForJreRange; import org.junit.jupiter.api.condition.JRE; import java.io.IOException; import java.io.Serializable; import java.math.BigInteger; import java.util.ArrayList; import java.util.List; public class SampleTest extends SerializeTestBase { @Test void testSample() throws IOException { Sample sample = new Sample(); Sample result = baseHessian2Serialize(sample); Assertions.assertEquals(sample.bigInteger, result.bigInteger); Assertions.assertEquals(sample.all, result.all); } private static class Sample implements Serializable { private BigInteger bigInteger = new BigInteger("1234567890"); private String all = "all"; } } ``` -- 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]
