Deleting combined fragment spanning multiple lifelines causes exception

Issue #295 resolved
Matthias Schoettle created an issue

When deleting a Combined Fragment that spans more than one lifeline an exception occurs. However, only for combined fragments that are nested in another combined fragment.

Caused by: java.lang.NullPointerException
    at ca.mcgill.sel.ram.ui.views.message.LifelineView$EventContainer.access$0(LifelineView.java:216)
    at ca.mcgill.sel.ram.ui.views.message.LifelineView.getViewIndex(LifelineView.java:968)
    at ca.mcgill.sel.ram.ui.views.message.LifelineView.addFragment(LifelineView.java:703)
    at ca.mcgill.sel.ram.ui.views.message.LifelineView.addMessageEnd(LifelineView.java:606)
    at ca.mcgill.sel.ram.ui.views.message.MessageViewView.addMessageView(MessageViewView.java:346)
    at ca.mcgill.sel.ram.ui.views.message.MessageViewView.notifyChanged(MessageViewView.java:889)
    at org.eclipse.emf.edit.provider.ChangeNotifier.fireNotifyChanged(ChangeNotifier.java:45)
    at org.eclipse.emf.edit.provider.ItemProviderAdapter.fireNotifyChanged(ItemProviderAdapter.java:239)
    at ca.mcgill.cs.sel.ram.provider.InteractionItemProvider.notifyChanged(InteractionItemProvider.java:133)

It seems that this is because all lifelines covered by the combined fragment are notified. The lifeline contains an OperandView which registers itself on the operand. This view will forward the notification to the MessageViewView, which means that after the first notification the combined fragment is removed and subsequent notifications will lead to this exception.

What is odd is, that this problem does not occur for "regular" combined fragments. It could be that the order of commands that are executed is different.

The same problem exists (if the above one does not happen) upon undoing the deletion of that combined fragment, which will lead to adding it again (and to both lifelines).

Comments (2)

  1. Log in to comment