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
I think it makes sense to have default values of list properties, set properties and similar immutable, but it's a bit cumbersome to have to work around the current value being immutable whenever we want to add or remove a value. It might make sense to just always hold the default value as mutable (i.e. by copying the default value over into an ArrayList or similar when it's not in the resource), or by providing a method that redefines the list to be mutable if needed (for ListProperty):
publicList<E> getOrInitAsMutableList(@NotNullSettingsManagersettingsManager) {
List<E> value = settingsManager.getProperty(this);
if (value.getClass() != ArrayList.class) {
value = newArrayList<>(value);
settingsManager.setProperty(this, value);
}
returnvalue;
}
I think ideally we have the default value immutable, the current value always mutable. I don't think the performance impact of copying over entries should be noticeable.
The text was updated successfully, but these errors were encountered:
…perty builders
- Arrays, inline arrays and collections are now based on property types which can be constructed from other property paths
- Introduce an enum set type
- Refactor the property builders (remove inheritance among builders, rename methods for default values to be more clear)
- Lift requirement that the collections in properties are always unmodifiable; to be seen in more depth with #379
I think it makes sense to have default values of list properties, set properties and similar immutable, but it's a bit cumbersome to have to work around the current value being immutable whenever we want to add or remove a value. It might make sense to just always hold the default value as mutable (i.e. by copying the default value over into an
ArrayList
or similar when it's not in the resource), or by providing a method that redefines the list to be mutable if needed (forListProperty
):I think ideally we have the default value immutable, the current value always mutable. I don't think the performance impact of copying over entries should be noticeable.
The text was updated successfully, but these errors were encountered: