You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assume the following class structure:
A
/ \
B C
| |
D D
A,B,C,D are classes. A has two fields of type B and C. Both B and C have a
field of type D.
EqualsVerifier.forClass(A.class).verify();
throws the exception:
java.lang.AssertionError: Recursive datastructure. Add prefab values for
one of the following classes: [class test.A, class test.B, class test.D,
class test.C].
I'm not sure if this is intentional, but if it is, then the error message
is misleading.
The problem might have something to do with
Instantiator.recursiveCallStack, which is not really a stack since elements
are added but never removed. Also the same recursiveCallStack instance is
used for the complete tree, but prefabValues is cloned. Therefore on the
second leg, D is not in prefabValues but in recursiveCallStack.
Cloning recursiveCallStack within createPrefabValues() did the trick, but I
don't know if this has any side effects (at least it still passes all tests).
Instantiator i = new Instantiator(type, prefabValues, (LinkedHashSet)
recursiveCallStack.clone());
I added the A,B,C,D example as an attachement.
-Stefan
Original issue reported on code.google.com by [email protected] on 12 Jan 2010 at 5:43
Original issue reported on code.google.com by
[email protected]
on 12 Jan 2010 at 5:43Attachments:
The text was updated successfully, but these errors were encountered: