Bug 484382 - NPE on Select Model Element Variable execution
Summary: NPE on Select Model Element Variable execution
Status: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: 3.1.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2015-12-15 05:11 EST by Esteban DUGUEPEROUX CLA
Modified: 2015-12-17 11:02 EST (History)
1 user (show)

See Also:


Attachments
Metamodel Projects (127.30 KB, application/zip)
2015-12-15 05:12 EST, Esteban DUGUEPEROUX CLA
no flags Details
VSP (4.64 KB, application/zip)
2015-12-15 05:12 EST, Esteban DUGUEPEROUX CLA
no flags Details
Project to reproduce (1.99 KB, application/zip)
2015-12-15 05:21 EST, Esteban DUGUEPEROUX CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Esteban DUGUEPEROUX CLA 2015-12-15 05:11:05 EST
Having a node creation tool with a "Select Model Element Variable" displaying objects in tree and executing this creation tool give the following exception :


org.eclipse.core.commands.ExecutionException: While executing the operation, an exception occurred
	at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:496)
	at org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramCommandStack.execute(DDiagramCommandStack.java:71)
	at org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramCommandStack.execute(DDiagramCommandStack.java:52)
	at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack.execute(DiagramCommandStack.java:156)
	at org.eclipse.gef.tools.AbstractTool.executeCommand(AbstractTool.java:425)
	at org.eclipse.gef.tools.AbstractTool.executeCurrentCommand(AbstractTool.java:438)
	at org.eclipse.gef.tools.CreationTool.performCreation(CreationTool.java:269)
	at org.eclipse.gef.tools.CreationTool.handleButtonUp(CreationTool.java:189)
	at org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java:1200)
	at org.eclipse.gef.EditDomain.mouseUp(EditDomain.java:301)
	at org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouseReleased(DomainEventDispatcher.java:380)
	at org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(LightweightSystem.java:548)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:220)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4482)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1329)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3820)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3431)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1132)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1023)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:157)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:651)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:595)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:670)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:609)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1516)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1489)
Caused by: org.eclipse.acceleo.query.runtime.AcceleoQueryEvaluationException: An internal error occured during evaluation of a query
	at org.eclipse.acceleo.query.runtime.impl.EvaluationServices.callOrApply(EvaluationServices.java:523)
	at org.eclipse.acceleo.query.parser.AstEvaluator.caseCall(AstEvaluator.java:211)
	at org.eclipse.acceleo.query.ast.util.AstSwitch.doSwitch(AstSwitch.java:126)
	at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:53)
	at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:69)
	at org.eclipse.acceleo.query.parser.AstEvaluator.caseCall(AstEvaluator.java:191)
	at org.eclipse.acceleo.query.ast.util.AstSwitch.doSwitch(AstSwitch.java:126)
	at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:53)
	at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:69)
	at org.eclipse.acceleo.query.parser.AstEvaluator.eval(AstEvaluator.java:111)
	at org.eclipse.acceleo.query.runtime.impl.QueryEvaluationEngine.eval(QueryEvaluationEngine.java:52)
	at org.eclipse.sirius.common.acceleo.aql.business.internal.AQLSiriusInterpreter.evaluateExpression(AQLSiriusInterpreter.java:208)
	at org.eclipse.sirius.common.acceleo.aql.business.internal.AQLSiriusInterpreter.evaluate(AQLSiriusInterpreter.java:190)
	at org.eclipse.sirius.common.tools.internal.interpreter.AbstractInterpreter.evaluateCollection(AbstractInterpreter.java:54)
	at org.eclipse.sirius.tools.internal.interpreter.ODesignGenericInterpreter.evaluateCollection(ODesignGenericInterpreter.java:164)
	at org.eclipse.sirius.business.internal.logger.RuntimeLoggerInterpreterImpl.evaluateCollection(RuntimeLoggerInterpreterImpl.java:167)
	at org.eclipse.sirius.business.api.helper.SelectionDescriptionHelper.computeChildren(SelectionDescriptionHelper.java:84)
	at org.eclipse.sirius.business.api.helper.SelectionDescriptionHelper.computeInput(SelectionDescriptionHelper.java:67)
	at org.eclipse.sirius.ui.tools.api.command.AbstractSWTCallback.computeInput(AbstractSWTCallback.java:104)
	at org.eclipse.sirius.ui.tools.api.command.AbstractSWTCallback.askForVariableValues(AbstractSWTCallback.java:78)
	at org.eclipse.sirius.business.api.helper.task.InitInterpreterVariablesTask.execute(InitInterpreterVariablesTask.java:170)
	at org.eclipse.sirius.business.api.helper.task.TaskExecutor.execute(TaskExecutor.java:64)
	at org.eclipse.sirius.tools.api.command.SiriusCommand.doExecute(SiriusCommand.java:80)
	at org.eclipse.emf.transaction.RecordingCommand.execute(RecordingCommand.java:135)
	at org.eclipse.sirius.diagram.ui.tools.api.command.GMFCommandWrapper.doExecuteWithResult(GMFCommandWrapper.java:102)
	at org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand.doExecute(AbstractTransactionalCommand.java:247)
	at org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:150)
	at org.eclipse.gmf.runtime.common.core.command.CompositeCommand.doExecuteWithResult(CompositeCommand.java:403)
	at org.eclipse.gmf.runtime.common.core.command.AbstractCommand.execute(AbstractCommand.java:134)
	at org.eclipse.sirius.diagram.ui.tools.internal.commands.WrappingCommandIgnoringAffectedFiles.execute(WrappingCommandIgnoringAffectedFiles.java:124)
	at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:488)
	... 39 more
Caused by: org.eclipse.acceleo.query.runtime.AcceleoQueryEvaluationException: An internal error occured during evaluation of a query
	at org.eclipse.acceleo.query.runtime.impl.EvaluationServices.call(EvaluationServices.java:321)
	at org.eclipse.acceleo.query.runtime.impl.EvaluationServices.callOrApply(EvaluationServices.java:517)
	... 69 more
Caused by: java.lang.NullPointerException
	at org.eclipse.acceleo.query.runtime.impl.EvaluationServices.getEParameters(EvaluationServices.java:475)
	at org.eclipse.acceleo.query.runtime.impl.EvaluationServices.callEOperation(EvaluationServices.java:344)
	at org.eclipse.acceleo.query.runtime.impl.EvaluationServices.call(EvaluationServices.java:308)
	... 70 more
Comment 1 Esteban DUGUEPEROUX CLA 2015-12-15 05:12:37 EST
Created attachment 258680 [details]
Metamodel Projects
Comment 2 Esteban DUGUEPEROUX CLA 2015-12-15 05:12:53 EST
Created attachment 258681 [details]
VSP
Comment 3 Esteban DUGUEPEROUX CLA 2015-12-15 05:21:15 EST
Created attachment 258682 [details]
Project to reproduce

Steps to reproduce:

1. Import in a first Sirius instance Bug484382_MetamodelProjects.zip to have metamodel
2. Import in a second Sirius instance, having the metamodel projects, Bug484382_VSP.zip to have odesign
3. Launch a third Sirius instance
4. In this third instance import Bug484382_ModelingProject.zip
5. In the imported Modeling Project, open the diagram, use the creation tool and click on diagram => KO we get the exceptions of previous comment.

This occurs because of mistakes in "Select Model Element Variable" children expression, i.e. "aql:self.eContents(aqlbug.A)->union(self.eContents(aqlbug.Package))", use incorrect qualified name for EClass.

We can notice an inconsistency in Sirius qualified name, for example in domain class field, we use dot notation while in aql expression we use "ePackageName::eClassName".

Using ""aql:self.eContents(aqlbug::A)->union(self.eContents(aqlbug::Package))" expression, the validation give an not understandable message :

Nothing left after union:
 Nothing will be left after calling eContents:
EClassifier=A cant contain EClassifierLiteral=A direclty
 Nothing will be left after calling eContents:
EClassifier=A cant contain EClassifierLiteral=Package direclty