[ECP] Two Implementations Avoids IllegalArgumentException: The class ... is not a valid classifier [message #1744335] |
Mon, 26 September 2016 01:16 |
|
Is the below a bug or expected behavior in ECP 1.9.0 (on Neon)?
Given the following:
- When an EClass (e.g. UserGroup) has an EReference to some other EClass (e.g. Foo);
- When that referred to EClass (e.g. Foo) is also an interface
- And there is only one EClass (e.g. FooOne) that uses the referred EClass as its ESuperType
The exception java.lang.IllegalArgumentException below occurs in ECP when clicking on the green plus button to create and link a new instance of the referred EClass.
The exception can be avoided by creating another EClass (e.g. FooTwo) that also uses the referred EClass as its ESuperType. When clicking the link + green plus button, a "New Reference Element" window pops up with both implementations selectable.
Steps to reproduce first part:
- Modify the Make It Happen example task.ecore model:
- Add a new EClass "Foo" to the tasks package; set its Interface property to true; add an EReference to UserGroup
- Add a new EClass "FooOne" also on tasks; set its ESuperType to "Foo"
- Add a new EReference to "UserGroup" that points to "Foo"; set its EOpposite to "userGroup"
- Save, Reload..., Generate Model Code, Generate Edit Code
- Launch the org.eclipse.emf.ecp.application.e4.product
- Create a new ECP Project, insert a new model element of UserGroup, and click on "Create and link new Foo". This should case an exception.
Steps to reproduce second part:
- Modify the Make It Happen example task.ecore model again:
- Add a new EClass "FooTwo" also on tasks; set its ESuperType to "Foo"
- Save, Reload..., Generate Model Code, Generate Edit Code
- Launch the org.eclipse.emf.ecp.application.e4.product
- Create a new ECP Project, insert a new model element of UserGroup, and click on "Create and link new Foo". This should work as normal.
!STACK 0
java.lang.IllegalArgumentException: The class 'Foo' is not a valid classifier
at org.eclipse.emf.ecp.makeithappen.model.task.impl.TaskFactoryImpl.create(TaskFactoryImpl.java:90)
at org.eclipse.emf.ecp.spi.ui.ECPReferenceServiceImpl.addNewModelElements(ECPReferenceServiceImpl.java:105)
at org.eclipse.emf.ecp.view.internal.core.swt.renderer.LinkControlSWTRenderer$7.widgetSelected(LinkControlSWTRenderer.java:263)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:249)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4248)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1501)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1524)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1509)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1313)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4072)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3698)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:161)
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:673)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
at org.eclipse.equinox.launcher.Main.main(Main.java:1492)
|
|
|
|
Powered by
FUDForum. Page generated in 0.02979 seconds