almondtools / testrecorder

Create Test Fixtures from Runnable Java Code
http://testrecorder.amygdalum.net/
GNU Lesser General Public License v3.0
51 stars 5 forks source link

Non-Recursive serialization #77

Closed almondtools closed 6 years ago

almondtools commented 6 years ago

Currently the object tree is traversed in a recursive way for serialization. This could lead to stack overflow exceptions if the tree is too deep.

It would be more robust to traverse the object tree in a non recursive breadth first strategy.

almondtools commented 6 years ago

Approach

We can implement this by giving each Serializer an additional method dependentObjects() which return all non-trivial objects the object to be serialized depends on.

The algorithm

Changes

This algorithm will not suffer from the problems with forward