Community
Participate
Working Groups
Created attachment 262526 [details] Wrong and correnct command/handler position in Application.e4xmi file. When I create wrong Application.e4xmi file, respectively incorrectly position of Handler and Command in wrong Model Fragment I get a exception that not contain appropriate exception message. !ENTRY org.eclipse.osgi 4 0 2016-06-19 18:02:54.614 !MESSAGE Application error !STACK 1 java.lang.ArrayStoreException: org.eclipse.e4.ui.model.application.commands.impl.HandlerImpl at org.eclipse.emf.common.util.BasicEList.assign(BasicEList.java:118) at org.eclipse.emf.common.util.BasicEList.addUnique(BasicEList.java:418) at org.eclipse.emf.common.notify.impl.NotifyingListImpl.doAddUnique(NotifyingListImpl.java:325) at org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUnique(NotifyingListImpl.java:309) at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList.java:303) at org.eclipse.e4.ui.model.internal.ModelUtils.mergeList(ModelUtils.java:197) at org.eclipse.e4.ui.model.internal.ModelUtils.merge(ModelUtils.java:145) at org.eclipse.e4.ui.model.fragment.impl.StringModelFragmentImpl.mergeIdList(StringModelFragmentImpl.java:322) at org.eclipse.e4.ui.model.fragment.impl.StringModelFragmentImpl.merge(StringModelFragmentImpl.java:300) at org.eclipse.e4.ui.internal.workbench.ModelAssembler.processFragment(ModelAssembler.java:192) at org.eclipse.e4.ui.internal.workbench.ModelAssembler.processFragments(ModelAssembler.java:103) at org.eclipse.e4.ui.internal.workbench.ModelAssembler.processModel(ModelAssembler.java:83) at org.eclipse.e4.ui.internal.workbench.ResourceHandler.loadMostRecentModel(ResourceHandler.java:259) at org.eclipse.e4.ui.internal.workbench.swt.E4Application.loadApplicationModel(E4Application.java:397) at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:254) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:628) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:606) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) at org.eclipse.chemclipse.rcp.app.ui.internal.support.ApplicationSupport.startGraphicalContext(ApplicationSupport.java:118) at org.eclipse.chemclipse.rcp.app.ui.internal.support.ApplicationSupport.start(ApplicationSupport.java:92) at org.eclipse.chemclipse.rcp.app.ui.Application.start(Application.java:34) 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:380) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608) at org.eclipse.equinox.launcher.Main.run(Main.java:1515) at org.eclipse.equinox.launcher.Main.main(Main.java:1488)
Created attachment 263250 [details] Demo application I've created a demo application to test this bug.
I've also created a Git repo to better understand the bug: https://github.com/OpenChrom/Eclipse-Bug496355 master -> application works demo_fails -> application fails (see fragment.e4xmi)
I think the error message is OK. The tooling should not allow to add objects into inappropriate target lists (for example, a handler into a commands list). Or at least there should be a validation error in the fragments editor.
(In reply to Erdal Karaca from comment #3) > Or at least there should be a validation error in the fragments editor. Patches welcome for adding this validation error
In the meantime, the model editor does not allow to add an inappropriate element to a target list by accident. This bug may be triggered if the XMI resource is manually edited in a text editor or the like. But as of Oxygen, it is not reproducible anymore when using the model editor. I think it has been fixed as of Bug 509464.
Just realized that this inconsistent state can be triggered via drag and drop as well. I.e. drag and drop operations of the model adapter for a consitent behavior. (In reply to Erdal Karaca from comment #5) > In the meantime, the model editor does not allow to add an inappropriate > element to a target list by accident. > > This bug may be triggered if the XMI resource is manually edited in a text > editor or the like. > > But as of Oxygen, it is not reproducible anymore when using the model editor. > > I think it has been fixed as of Bug 509464.
My last sentence should read: I.e. drag and drop operations of the model editor should also be adapted/enhanced for a consistent behavior. (In reply to Erdal Karaca from comment #6) > Just realized that this inconsistent state can be triggered via drag and > drop as well. I.e. drag and drop operations of the model adapter for a > consitent behavior. > > (In reply to Erdal Karaca from comment #5) > > In the meantime, the model editor does not allow to add an inappropriate > > element to a target list by accident. > > > > This bug may be triggered if the XMI resource is manually edited in a text > > editor or the like. > > > > But as of Oxygen, it is not reproducible anymore when using the model editor. > > > > I think it has been fixed as of Bug 509464.
Erdal, could you provide a patch?
I am trying... there is some duplicated code within copy+paste and drag+drop. I think the lack of syncing both aspects makes the model editor behave indeterministic: DND sometimes allows invalid operations and sometimes not. (In reply to Lars Vogel from comment #8) > Erdal, could you provide a patch?