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
Sebastian Gröbler edited this page Nov 16, 2013
·
5 revisions
What happens if there are cylces in the object graph?
In case you try to diff a graph that contains cycles the Differ will end up throwing an OutOfMemoryError. There is no cycle detection logic implemented, thus avoiding cycles is in the responsibility of the client. There are basically two ways to avoid cycles:
Cut the cycle by excluding a property that is part of the reference cycle and diff the objects below the "cut" in a separate call.
Cut the cycle by providing a CheckableSerializer implementation for a property type that is part of the reference cylce.
How are Lists serialized?
Lists are sorted by either a provided naturally ordered class (implements Comparable) or a comparator and then serialized with an index like this:
Maps are sorted by either a provided naturally ordered class (implements Comparable) or a comparator. A sorted map is a map that is sorted by it's keys.