Community
Participate
Working Groups
+++ This bug was initially created as a clone of Bug #437251 +++ Steps to reproduce : - install EcoreTools from http://download.eclipse.org/modeling/emft/ecoretools/updates/milestones/2.0.0RC4a/luna - restart Eclipse making sure nothing from Sirius is loaded (you should not be in the modeling perspective or have a View from Sirius opened), the bug has been reproduced successfully with the Java perspective - import a project with a Ecore file (importing ExtLibrary from the examples with the New-> wizard for instance) - right click on the .ecore file, "Initialize Ecore Diagram" - go through the steps to create a new representation result : nothing happens and you have a error which is logged in the error log view. expected result : the representation is opened The bug has not been reproduced on Linux systems so far. NPEs are coming from : Caused by: java.lang.NullPointerException at org.eclipse.sirius.ui.tools.internal.actions.creation.CreateRepresentationAction$1.run(CreateRepresentationAction.java:126) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122) Looking at the code, this action expect an EditingSession to be here but none has been created yet. This is probably a side effect of the lazyness recently introduced. Workaround in EcoreTools is to explicitely call IEditingSession uiSession = SessionUIManager.INSTANCE .getOrCreateUISession(existingSession); uiSession.open(); Before reusing the CreateRepresentationAction.
See https://git.eclipse.org/r/#/c/30408/ for a first workaround on master (correction done on 1.0.1)
(In reply to Maxime Porhel from comment #1) > See https://git.eclipse.org/r/#/c/30408/ for a first workaround on master > (correction done on 1.0.1) Wrong url, please see: https://git.eclipse.org/r/#/c/29988/
This only correct the NPE. As proposed by Cedric: > to get rid of this altogether or at least make sure we don't really need to keep > it in sync with Session instances through a specific sessionmanager listener. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=437251#c11
The workaround has been submitted on master to avoid potential NPE, see commit ba38f5e030ab4bfd1ede177104a4d3384c93ad5b See comments on Bug 437251 for the remaining work.
Moving out of the 4.0 scope for now, along with all the other issues which were there "by default". This does not mean some of these will not be re-integrated at some point, but for now these issues are not part of the roadmap for 4.0. If you feel strongly about this removal from 4.0 and/or are ready to sponsor the corresponding work, feel free to comment.