AllocationTables return unmodifiable ELists for getters of their entries
Problem description.
The specializations of AllocationTable offer convenience methods to
access their elements (e.g., getPartitions()). Internally, these methods
build on EcoreUtils.pickInstanceOf(…) that return a unmodifiable EList.
This breaks the standard behavior of EMF models that return modifiable
ELists, e.g., to add new elements.
Currently, modifications have to be performed on the EContainedElement
list.
Desired change.
The convenience methods should return modifiable ELists. Two variants to implement this change come to my mind:
- Use LambdaUtils filter methods that allow to pass a target list for the returned elements (in this case BasicEList).
- Extend the pickInstanceOf methods with a boolean parameter that defines whether the returned list shall be modifiable, along with a wrapper for the current behavior.
(from redmine: issue id 3322, created on 2018-03-07, closed on 2018-03-07)