watchdog icon indicating copy to clipboard operation
watchdog copied to clipboard

Change collection type of projectsettings to Map

Open TimvdLippe opened this issue 7 years ago • 1 comments

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.

TimvdLippe avatar May 01 '18 14:05 TimvdLippe

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

Inventitech avatar May 02 '18 08:05 Inventitech