eclipse-gemoc / eclipse-gemoc/gemoc-studio-modeldebugging

Fail to execute model without aird for languages with inheritance

Open
#4 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
6
Forks
14
PR merge metrics
No merged PRs in 30d

Description

In the offical example SequentialFSM,
if we create a launch configuration that doesn't specify the animation aird, then the execution fails with an exception in the model loader

```
54582462 [Worker-48] ERROR fr.inria.diverse.melange.resource.MelangeDerivedStateComputer - Fatal exception
java.lang.NullPointerException
at fr.inria.diverse.melange.utils.EPackageProvider.getPackages(EPackageProvider.java:89)
at fr.inria.diverse.melange.utils.EPackageProvider$1.apply(EPackageProvider.java:138)
at fr.inria.diverse.melange.utils.EPackageProvider$1.apply(EPackageProvider.java:1)
at org.eclipse.xtext.xbase.lib.internal.FunctionDelegate.apply(FunctionDelegate.java:42)
at com.google.common.collect.Iterators$8.transform(Iterators.java:794)
at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
at com.google.common.collect.Iterators$5.hasNext(Iterators.java:543)
at com.google.common.collect.AbstractMultimap.putAll(AbstractMultimap.java:82)
at com.google.common.collect.HashMultimap.putAll(HashMultimap.java:49)
at fr.inria.diverse.melange.utils.EPackageProvider.getPackages(EPackageProvider.java:165)
at fr.inria.diverse.melange.ast.ModelingElementExtensions.getPkgs(ModelingElementExtensions.java:93)
at fr.inria.diverse.melange.ast.LanguageExtensions.isTypable(LanguageExtensions.java:293)
at fr.inria.diverse.melange.ast.ModelTypeExtensions.isComparable(ModelTypeExtensions.java:424)
at fr.inria.diverse.melange.processors.TypingInferrer$5.apply(TypingInferrer.java:109)
at fr.inria.diverse.melange.processors.TypingInferrer$5.apply(TypingInferrer.java:1)
at org.eclipse.xtext.xbase.lib.internal.BooleanFunctionDelegate.apply(BooleanFunctionDelegate.java:41)
at com.google.common.collect.Iterators$7.computeNext(Iterators.java:647)
at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
at java.lang.Iterable.forEach(Iterable.java:74)
at fr.inria.diverse.melange.processors.TypingInferrer._preProcess(TypingInferrer.java:179)
at fr.inria.diverse.melange.processors.TypingInferrer.preProcess(TypingInferrer.java:205)
at fr.inria.diverse.melange.resource.MelangeDerivedStateComputer$1.accept(MelangeDerivedStateComputer.java:111)
at fr.inria.diverse.melange.resource.MelangeDerivedStateComputer$1.accept(MelangeDerivedStateComputer.java:1)
at java.util.ArrayList.forEach(ArrayList.java:1249)
at fr.inria.diverse.melange.resource.MelangeDerivedStateComputer.installDerivedState(MelangeDerivedStateComputer.java:115)
at org.eclipse.xtext.resource.DerivedStateAwareResource.installDerivedState(DerivedStateAwareResource.java:242)
at org.eclipse.xtext.xbase.resource.BatchLinkableResource.getContents(BatchLinkableResource.java:148)
at fr.inria.diverse.melange.resource.MelangeResourceImpl.getXmofURI(MelangeResourceImpl.java:457)
at fr.inria.diverse.melange.resource.MelangeResourceImpl.adaptResourceToLang(MelangeResourceImpl.java:308)
at fr.inria.diverse.melange.resource.MelangeResourceImpl.doAdapt(MelangeResourceImpl.java:487)
at fr.inria.diverse.melange.resource.MelangeResourceImpl.eAdapters(MelangeResourceImpl.java:538)
at org.eclipse.xtext.resource.XtextResourceSet$ResourcesList.inverseAdd(XtextResourceSet.java:151)
at org.eclipse.xtext.resource.XtextResourceSet$ResourcesList.inverseAdd(XtextResourceSet.java:1)
at org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUnique(NotifyingListImpl.java:312)
at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList.java:303)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.createResource(ResourceSetImpl.java:435)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.createResource(ResourceSetImpl.java:423)
at org.eclipse.gemoc.executionframework.extensions.sirius.modelloader.DefaultModelLoader.loadModel(DefaultModelLoader.java:185)
at org.eclipse.gemoc.executionframework.extensions.sirius.modelloader.DefaultModelLoader.loadModel(DefaultModelLoader.java:114)
at org.eclipse.gemoc.executionframework.engine.commons.ModelExecutionContext.initializeResourceModel(ModelExecutionContext.java:73)
at org.eclipse.gemoc.execution.sequential.javaengine.ui.launcher.Launcher.createExecutionEngine(Launcher.java:64)
at org.eclipse.gemoc.executionframework.engine.ui.launcher.AbstractSequentialGemocLauncher.launch(AbstractSequentialGemocLauncher.java:106)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:885)

```

additionnally, after such failure, when trying to create the missing aird, in a new representation file (aird), the model may stay in a strange state where Sirius fails to associate the view point to the model with the following exception

```
!ENTRY org.eclipse.sirius.ui 4 0 2017-09-15 09:23:01.849
!MESSAGE Error creating Representations File
!STACK 0
java.lang.NullPointerException
at org.eclipse.gemoc.executionframework.extensions.sirius.modelloader.DebugPermissionAuthority.canEditInstance(DebugPermissionAuthority.java:58)
at org.eclipse.sirius.ecore.extender.business.internal.permission.ReadOnlyWrapperPermissionAuthority.canEditInstance(ReadOnlyWrapperPermissionAuthority.java:95)
at org.eclipse.sirius.diagram.business.internal.experimental.sync.DDiagramSynchronizer.refreshOperation(DDiagramSynchronizer.java:370)
at org.eclipse.sirius.diagram.business.internal.experimental.sync.DDiagramSynchronizer.refresh(DDiagramSynchronizer.java:356)
at org.eclipse.sirius.diagram.business.internal.sync.DDiagramSynchronizer.refresh(DDiagramSynchronizer.java:91)
at org.eclipse.sirius.diagram.business.internal.dialect.DiagramDialectServices.refresh(DiagramDialectServices.java:271)
at org.eclipse.sirius.business.internal.dialect.DialectManagerImpl.refresh(DialectManagerImpl.java:115)
at org.eclipse.sirius.business.internal.dialect.DialectManagerImpl.refresh(DialectManagerImpl.java:106)
at org.eclipse.sirius.diagram.business.internal.dialect.DiagramDialectServices.createRepresentation(DiagramDialectServices.java:193)
at org.eclipse.sirius.business.internal.dialect.DialectManagerImpl.createRepresentation(DialectManagerImpl.java:153)
at org.eclipse.sirius.diagram.tools.api.command.view.CreateDiagramWithInitialOperation.execute(CreateDiagramWithInitialOperation.java:98)
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.emf.workspace.EMFCommandOperation.doExecute(EMFCommandOperation.java:119)
at org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:150)
at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:488)
at org.eclipse.emf.workspace.impl.WorkspaceCommandStackImpl.doExecute(WorkspaceCommandStackImpl.java:208)
at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:165)
at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:219)
at org.eclipse.sirius.diagram.business.internal.dialect.DiagramDialectServices.initRepresentationForElement(DiagramDialectServices.java:354)
at org.eclipse.sirius.business.api.dialect.AbstractRepresentationDialectServices.initRepresentations(AbstractRepresentationDialectServices.java:546)
at org.eclipse.sirius.business.api.dialect.AbstractRepresentationDialectServices.initRepresentations(AbstractRepresentationDialectServices.java:497)
at org.eclipse.sirius.diagram.business.internal.dialect.DiagramDialectServices.initRepresentations(DiagramDialectServices.java:334)
at org.eclipse.sirius.business.internal.dialect.DialectManagerImpl.initRepresentations(DialectManagerImpl.java:360)
at org.eclipse.sirius.business.internal.session.danalysis.DViewOperations.createView(DViewOperations.java:128)
at org.eclipse.sirius.business.internal.session.danalysis.DAnalysisSessionImpl.createView(DAnalysisSessionImpl.java:1139)
at org.eclipse.sirius.business.api.session.ViewpointSelector.selectViewpoint(ViewpointSelector.java:79)
at org.eclipse.sirius.ui.business.api.viewpoint.ViewpointSelectionCallback.selectViewpoint(ViewpointSelectionCallback.java:40)
at org.eclipse.sirius.ui.business.internal.commands.ChangeViewpointSelectionCommand.doExecute(ChangeViewpointSelectionCommand.java:112)
at org.eclipse.emf.transaction.RecordingCommand.execute(RecordingCommand.java:135)
at org.eclipse.emf.workspace.EMFCommandOperation.doExecute(EMFCommandOperation.java:119)
at org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:150)
at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:488)
at org.eclipse.emf.workspace.impl.WorkspaceCommandStackImpl.doExecute(WorkspaceCommandStackImpl.java:208)
at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:165)
at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:219)
at org.eclipse.sirius.ui.business.api.viewpoint.ViewpointSelection$8.run(ViewpointSelection.java:489)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)

```

In order to successfully be able to add the view points and patch the launch configuation, we need, at minimum, to close and re-open the project containing the model (or more radically, restart eclipse :wink: )

steps to reproduce the issue:
- install fsm example language and model in their respective workbenches
- in the modeling workbench, copy a model that usually work (only the .fsm) create a launch configuration for it without specifying the aird.
- launch the model (debug mode) -> crash
- then right click on the fsm and try to create a representation and select the FSM and XFSM view points.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.