capella
capella copied to clipboard
Undo of State creation on MSM diagrams fail if state grandparent is a StateMachine.
Attachment: stackTrace.txt StackTrace of the exception after undo.
On MSM diagram, if the user undo a State creation, which container of the container is an AbstractState, an exception occurs : BasicIndexOutOfBoundsException
Scenario to reproduce:
1- Create a Capella project 2- Add a StateMachine on the root LogicalSystem (LogicalArchitecture>Structure>LogicalSystem) 3- Add a State on the region of the previous created StateMachine 4- Create a MSM diagram on the region of the new State 5- Create two states 6- Undo -> an exception occurs
After few analysis, it seems that during undo, list of object to change is first recovered (class ChangeDescriptionImpl.java). Then for each object to change, we reverse operation on their features (featureChange.applyAndReverse(objectToChange)). The first object to change is the region on which we remove the state from involvedState (containement=false) and ownedState (containement=true)reference. The second object to change is the StateMachine on which we remove the state from referencedStates (containement=false) reference but it has already been removed previously, so an exception occurs.
🆔 ECLIPSE-553857
👷 jessy.mallet
📅 2019-12-06
felix.dorner commented on 2019-12-06
I can reproduce. This is caused by the data notifier reacting blindly to single notifications, regardless of context. Quite hard to fix without changing the DataNotifier itself.