Community
Participate
Working Groups
Build Identifier: M20100211-1343 The org.eclipse.ui.internal.PartStack.replace(LayoutPart, LayoutPart) method assumes that: [line 904] int idx = children.indexOf(oldChild); returns a valid number to use at line 914 of the same method: [line 914] children.add(idx, newChild); However if one is using activities (org.eclipse.ui.activities extension point) to filter certain Workbench Parts it is possible that this does not hold true. This is very hard to reproduce since it involves concurrent conditions between the activities mechanism and the PartStack methods. Stacktrace: !ENTRY org.eclipse.ui 4 0 2010-03-10 15:41:35.787 !MESSAGE Unhandled event loop exception !STACK 0 java.lang.IndexOutOfBoundsException: Index: -1, Size: 1 at java.util.ArrayList.add(ArrayList.java:367) at org.eclipse.ui.internal.PartStack.replace(PartStack.java:914) at org.eclipse.ui.internal.PerspectiveHelper.removePart(PerspectiveHelper.java:1231) at org.eclipse.ui.internal.Perspective.addFastView(Perspective.java:204) at org.eclipse.ui.internal.Perspective.makeFastView(Perspective.java:189) at org.eclipse.ui.internal.WorkbenchPage.makeFastView(WorkbenchPage.java:665) at org.eclipse.ui.internal.FastViewManager.makeFast(FastViewManager.java:376) at org.eclipse.ui.internal.FastViewManager.addViewReference(FastViewManager.java:257) at org.eclipse.ui.handlers.ShowViewHandler.openView(ShowViewHandler.java:147) at org.eclipse.ui.handlers.ShowViewHandler.execute(ShowViewHandler.java:80) at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:294) at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476) at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508) at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169) at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241) at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:770) at org.eclipse.ui.menus.CommandContributionItem.access$10(CommandContributionItem.java:756) at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:746) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3880) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3473) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at com.criticalsoftware.workbench.Application.start(Application.java:21) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514) at org.eclipse.equinox.launcher.Main.run(Main.java:1311) at org.eclipse.equinox.launcher.Main.main(Main.java:1287) Reproducible: Always Steps to Reproduce: This exception is not trivial to reproduce, since it needs concurrent enablement /disablement of activities while the org.eclipse.ui.handlers.ShowViewHandler.openView() executes. Or at least this is what i think ... See the stacktrace for details.
there's an additional exception I'm getting along with the one previously reported. I should mention that these exceptions are thrown when attempting to show views either from the fastviews menus or the main menu bar (particularly in my tests the LogView). Stacktrace: !ENTRY org.eclipse.ui 4 0 2010-03-10 18:29:33.100 !MESSAGE Unhandled event loop exception !STACK 0 java.lang.NullPointerException at org.eclipse.ui.internal.PerspectiveHelper.removePart(PerspectiveHelper.java:1277) at org.eclipse.ui.internal.Perspective.addFastView(Perspective.java:204) at org.eclipse.ui.internal.Perspective.makeFastView(Perspective.java:189) at org.eclipse.ui.internal.WorkbenchPage.makeFastView(WorkbenchPage.java:665) at org.eclipse.ui.internal.FastViewManager.makeFast(FastViewManager.java:376) at org.eclipse.ui.internal.FastViewManager.addViewReference(FastViewManager.java:257) at org.eclipse.ui.handlers.ShowViewHandler.openView(ShowViewHandler.java:147) at org.eclipse.ui.handlers.ShowViewHandler.execute(ShowViewHandler.java:80) at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:294) at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476) at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508) at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169) at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241) at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:770) at org.eclipse.ui.menus.CommandContributionItem.access$10(CommandContributionItem.java:756) at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:746) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3880) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3473) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at com.criticalsoftware.workbench.Application.start(Application.java:21) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514) at org.eclipse.equinox.launcher.Main.run(Main.java:1311) at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
Andre, can you give us a flavor of the types of concurrency issues you allude to in the 'to repro' comments? Is there some background task changing the activities in a background thread while you're doing this? If not could you provide an outline of what you think is happening?
yes, in my app is possible for a background thread to change the activities (that filter the visibility of certain workbench parts) while the user may be opening the fast view menu to open the same workbench parts.
My suggestion would be to move the code that is changing activities onto the UI thread using either 'synchExec' or 'asynchExec'. This will likely prevent this particular scenario from occurring. It will not, however, prevent your users from becoming confused when the view they just opened disappears...;-).
is that a "won't fix"? :)
Not really so much, just a suggestion to hopefully get you going again... Making the complete UI API thread-safe (or IMO even this part of it) isn't likely to happen in 3.6 though...how about 'unlikely'...;-).
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. If you have further information on the current state of the bug, please add it. 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.