Crash in message view when multiple selectors are opened.

Issue #361 resolved
Cécile Camillieri created an issue

In the message view, if you select an element in a selector and another selector is opened the application will crash.

Steps to reproduce:

  • Create a message view
  • Draw line to open a selector (there is no need to select anything in it).
  • Draw another line to open a second selector.
  • Go through the selection of an element in one of the selectors, the application will crash as follows:
org.eclipse.emf.common.util.WrappedException: An exception was ignored during command execution
    at org.eclipse.emf.common.command.BasicCommandStack.handleError(BasicCommandStack.java:281)
    at org.eclipse.emf.common.command.BasicCommandStack.execute(BasicCommandStack.java:112)
    at ca.mcgill.sel.core.controller.CoreBaseController.doExecute(CoreBaseController.java:102)
    at ca.mcgill.sel.ram.controller.MessageViewController.createLifelineWithMessage(MessageViewController.java:170)
....
Caused by: java.lang.NullPointerException
    at ca.mcgill.sel.ram.ui.views.message.MessageViewView.layoutLifelines(MessageViewView.java:675)
    at ca.mcgill.sel.ram.ui.views.message.MessageViewView.layoutMessageView(MessageViewView.java:647)
    at ca.mcgill.sel.ram.ui.views.message.MessageViewView.addMessageView(MessageViewView.java:409)

Comments (3)

  1. Matthias Schoettle

    The reason is that during new message creation temporary objects are added to the model in order to reuse the existing selector and choice of value mechanism.

    Instead of having to deal with temporary lifelines and messages in the layouting (that need to be ignored), the easiest right now is to prevent several messages to be created in the first place. I.e., while a selector is open, no new other message creations can be triggered.

  2. Matthias Schoettle

    In the future, instead of creating temporary objects, the new RAMInterfaceUtil should be used to get the choice of values.

  3. Log in to comment