dubbo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] zonghaishang commented on issue #174: dubbo调用中,bean反序列化后属性丢失
Date Tue, 27 Mar 2018 06:43:51 GMT
zonghaishang commented on issue #174: dubbo调用中,bean反序列化后属性丢失
URL: https://github.com/apache/incubator-dubbo/issues/174#issuecomment-376414910
   I have tested the problem without you saying, Here is my test code:
   ``` java
   public class Father implements Serializable {
       public int age;
       public String name;
   public class Son extends Father {
       public String name;
       public void serialize_inherited_model_then_deserialize() throws Exception {
           Son son = new Son();
           son.age = 40;
           son.name = "jason";
           ByteArrayOutputStream bout = new ByteArrayOutputStream();
           Hessian2Output out = new Hessian2Output(bout);
           ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
           Hessian2Input input = new Hessian2Input(bin);
           Son deserializeSon = (Son)input.readObject(Son.class);
           assertTrue(deserializeSon != null);
           assertEquals(40, deserializeSon.age);
           assertEquals("jason", deserializeSon.name);
   I'm using dubbo 2.6.1, please attach your code and dubbo version, thanks.

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

With regards,
Apache Git Services

View raw message