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
`synchronizedSet(s)` ends up making a new wrapper for the supplied set, which
means on subsequent calls, it becomes a SynchronizedSet, wrapped in a
SynchronizedSet, wrapped ... etc.
When using the LocalDataStore, the ParseObject.State is reused for every
matching ClassName+ObjectId pair, so every time a ParseObject is parsed from
JSON data, the existing object is "refreshed" by making a copy of its State,
and then merging with the new data. Every call to State.newBuilder() is
therefore adding a new layer of SynchronizedSet to the availableKeys Set.
Eventually that nested hierarchy of sets becomes so large that it causes a
StackOverflowError for any operation on the collection.
By making a copy of the set before wrapping it in synchronizedSet(), that
nested hierarchy becomes severed, and we end up with just one level of
wrappers.
0 commit comments