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
The following class triggers a Recursive Datastructure error in EqualsVerifier:
public class Outer {
private Inner inner;
private class Inner {
int i;
}
}
This happens because Inner gets an implicit reference to Outer (because
Inner isn't static).
EqualsVerifier probably shouldn't think of this as a recursive
datastructure, even though technically it is.
Original issue reported on code.google.com by [email protected] on 15 Apr 2010 at 3:57
The text was updated successfully, but these errors were encountered:
The implicit reference that inner classes get to their enclosing outer classes,
are
marked "synthetic" by the compiler. Since synthetic fields aren't supposed to
be used
by programmers and can only be accessed by reflection, they can safely be
ignored by
EqualsVerifier. Checking Field.isSynthetic() does the trick.
For more info, see
http://java.sun.com/docs/books/tutorial/reflect/member/fieldModifiers.html
Original issue reported on code.google.com by
[email protected]
on 15 Apr 2010 at 3:57The text was updated successfully, but these errors were encountered: