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

Change collection type of projectsettings to Map #300

Open
TimvdLippe opened this issue May 1, 2018 · 1 comment
Open

Change collection type of projectsettings to Map #300

TimvdLippe opened this issue May 1, 2018 · 1 comment

Comments

@TimvdLippe
Copy link
Collaborator

The current implementation in Preferences is that the project settings are a list. The invariant of "one project in this collection" is manually enforced with getOrCreateProjectSetting. However, we can better use Map here (and implement the corresponding equals/hashcode) to let the collection do this for us. That way we can make sure we always have one by retrieving it directly from https://docs.oracle.com/javase/8/docs/api/java/util/Map.html#getOrDefault-java.lang.Object-V- and put the value whenever we need it.

@Inventitech
Copy link
Contributor

Yeah, I think the reason is the Eclipse persister, which does (did) not support the Map datatype.

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

No branches or pull requests

2 participants