stackoverflow when serializing an object with list
See original GitHub issueI met stackoverflow when pass an object with arraylist, code is as blew:
List<SerializablePerson> list = new ArrayList<SerializablePerson>();
list.add(new SerializablePerson());
list.add(new SerializablePerson());
list.add(new SerializablePerson());
PersonList obj = new PersonList(list);
Schema schema = RuntimeSchema.getSchema(obj.getClass());
// both two toByteArray method will cause stackoverflow.
bytes = GraphIOUtil.toByteArray(obj, schema, buffer);
bytes = ProtobufIOUtil.toByteArray(obj, schema, buffer);
classNameBytes = obj.getClass().getName().getBytes();
Was it wrong about the usage?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to serialize List<List<object>>? - Stack Overflow
1 Answer 1 ... Use the Type property to specify an overridden type for a public field or public read/write property value. If...
Read more >Stackoverflow Exception when serializing certain objects that ...
I encountered a stackoverflow exception while serializing an object who's purpose is to convey a tree structure.
Read more >1.16.5 - Serializing objects - StackOverFlow Error | SpigotMC
I'm trying to serialize the following object: public class ObjectExample implements Serializable { private final CInventory cInventory; ...
Read more >Java Serialization and Deserialization Examples - Mkyong.com
In Java, Serialization means converting Java objects into a byte stream; Deserialization means converting the serialized object's byte ...
Read more >Spring Boot and Jackson: How to Get Around That Infinite ...
... Jackson: How to Get Around That Infinite Recursion or StackOverflow Problem. Spring Boot. Having a problem using Jackson to serialize your Java...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Since that is an inner class, mark it static:
private static class LocalTimeList
That test will now pass.Thanks!