Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModelWrapper non-deterministic commit/reload order #376

Closed
sideisra opened this issue Apr 11, 2016 · 0 comments
Closed

ModelWrapper non-deterministic commit/reload order #376

sideisra opened this issue Apr 11, 2016 · 0 comments
Milestone

Comments

@sideisra
Copy link
Contributor

When commiting or reloading values with model wrapper the order of the updates is non-deterministic due to the internal usage of HashSet to manage the fields.
In some cases this is problematic.
Example:
in our project we use the ModelWrapper to map a list and based on the elements of that list a StringProperty. When the StringProperty changes, its value has to be applied to all list elements.
When an element is added to the list and the StringProperty is changed it sometimes happens that the string property is applied to the old list items only because the StringPeroperty change is applied first, Subsequent list changes override the StringProperty change.

The solution would be to have more control over the change order. I suggest the use of a LinkedHashSet. It also has the ability to ignore/detect duplicates but it also garantees a special iteration order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants