| Summary: | IllegalArgumentException using placeholder in model fragments | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Simon Scholz <simon.scholz> | ||||
| Component: | UI | Assignee: | Platform-UI-Inbox <Platform-UI-Inbox> | ||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||
| Severity: | critical | ||||||
| Priority: | P3 | CC: | eclipse, Lars.Vogel, loskutov, rolf.theunissen | ||||
| Version: | 4.6 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | All | ||||||
| See Also: |
https://bugs.eclipse.org/bugs/show_bug.cgi?id=547503 https://bugs.eclipse.org/bugs/show_bug.cgi?id=487748 |
||||||
| Whiteboard: | stalebug | ||||||
| Attachments: |
|
||||||
Simon, is this a regression in 4.12? The actual problem, which causes this IllegalArgumentException is that the shared element part is inside a org.eclipse.e4.ui.model.fragment.impl.StringModelFragmentImpl container instead of being merged into to actual application model tree. Therefore the org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.getTopLevelWindowFor(MUIElement) method returns null and causes this error. I don't know why the container of the shared part is still a StringModelFragmentImpl rather than the window where it belongs to at runtime. (In reply to Andrey Loskutov from comment #1) > Simon, is this a regression in 4.12? No, unfortunately it's not that easy. We tested it with the current release and even tested it with Eclipse 4.6 and also with an integration build from last week. Simon, looks like your runtime model contains elements without parents. Would be good to know if the save model is wrong or the loaded model. Can you add a test to ModelAssemblerTests to checks this? The error does not occur in the following cases: 1. When the fragment is only applied when it not exists, apply="notexists" in plugin.xml 2. When the view was active when the window is closed. Especially option 1 makes me believe that the error is caused by re-applying the snippet to the model. Probably a duplicate of Bug 487748 (In reply to Rolf Theunissen from comment #6) > Probably a duplicate of Bug 487748 And Bug 487748 is a duplicate of Bug 440030 This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. |
Created attachment 278667 [details] Sample e4 application to reproduce the error Hi, I've attached a sample application, which can be started by using the product inside the brokenmodel project. Steps to reproduce. 1) Start the application by using the product 2) Close the application (causes save of a workbench.xmi file) 3) Restart the application (without -clearPersistedState flag -> loads workbench.xmi) 4) Click on "Shared Part" tab These steps cause the following error: !MESSAGE Internal Error !STACK 0 java.lang.IllegalArgumentException: at org.eclipse.core.runtime.Assert.isLegal(Assert.java:66) at org.eclipse.core.runtime.Assert.isLegal(Assert.java:50) at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.findElementsRecursive(ModelServiceImpl.java:175) at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.findPerspectiveElements(ModelServiceImpl.java:438) at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.findPlaceholderFor(ModelServiceImpl.java:661) at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:624) at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:616) at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.delegateBringToTop(PartServiceImpl.java:791) at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:762) at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:684) at org.eclipse.e4.ui.internal.workbench.swt.AbstractPartRenderer.activate(AbstractPartRenderer.java:97) at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.lambda$3(StackRenderer.java:1058) at org.eclipse.swt.events.SelectionListener$1.widgetSelected(SelectionListener.java:84) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:252) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5874) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1400) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1426) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1409) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1198) at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3193) at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:1876) at org.eclipse.swt.custom.CTabFolder.lambda$0(CTabFolder.java:330) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5874) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1400) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:5138) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4663) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1173) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1062) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:166) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) 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:661) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597) at org.eclipse.equinox.launcher.Main.run(Main.java:1476) at org.eclipse.equinox.launcher.Main.main(Main.java:1449)