xiaoheng1 opened a new issue #8742: URL: https://github.com/apache/dubbo/issues/8742
- [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate. - [ ] I have checked the [FAQ](https://github.com/apache/dubbo/blob/master/FAQ.md) of this repository and believe that this is not a duplicate. ### Environment * Dubbo version: dubbo3+ * Operating System version: macos * Java version: 11 ### Steps to reproduce this issue test caseļ¼ ``` public class Main1 { public static void main(String[] args) { Foo f = new Foo(); f.setZ("ZZZ"); B a = new B(); a.setName("BBB"); a.setAge("13"); f.setA(a); Schema<Foo> schema = RuntimeSchema.getSchema(Foo.class); // Re-use (manage) this buffer to avoid allocating on every serialization LinkedBuffer buffer = LinkedBuffer.allocate(512); // ser final byte[] protostuff; try { protostuff = ProtostuffIOUtil.toByteArray(f, schema, buffer); } finally { buffer.clear(); } // deser Schema<Foo> schema1 = RuntimeSchema.getSchema(Foo.class); Foo fooParsed = schema1.newMessage(); ProtostuffIOUtil.mergeFrom(protostuff, fooParsed, schema1); System.out.println(fooParsed); } static class Foo { Foo() { System.out.println("AA"); } private A a; private String z; public String getZ() { return z; } public void setZ(String z) { this.z = z; } public A getA() { return a; } public void setA(A a) { this.a = a; } } static class A { private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } } static class B extends A { private String age; public String getAge() { return age; } public void setAge(String age) { this.age = age; } } } ``` link https://github.com/protostuff/protostuff/issues/316 -- 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]
