Community
Participate
Working Groups
When I try to remove an object from within the elements area of the task editor context page, I get the exception below. The attached patch fixes it. We need to pass an empty selection for any selection events, not null. Daemon Thread [Thread-1] (Suspended (exception AssertionFailedException)) Assert.isNotNull(Object, String) line: 85 Assert.isNotNull(Object) line: 73 SelectionChangedEvent.<init>(ISelectionProvider, ISelection) line: 46 SelectionProviderAdapter.setSelection(ISelection) line: 75 InterestDecrementAction(AbstractInterestManipulationAction).run(IAction) line: 100 ObjectPluginAction(PluginAction).runWithEvent(Event) line: 251 PluginActionContributionItem(ActionContributionItem).handleWidgetSelection(Event, boolean) line: 584 ActionContributionItem.access$2(ActionContributionItem, Event, boolean) line: 501 ActionContributionItem$5.handleEvent(Event) line: 411 EventTable.sendEvent(Event) line: 84 Display.sendEvent(EventTable, Event) line: 4125 MenuItem(Widget).sendEvent(Event) line: 1457 MenuItem(Widget).sendEvent(int, Event, boolean) line: 1480 MenuItem(Widget).sendEvent(int, Event) line: 1465 MenuItem(Widget).notifyListeners(int, Event) line: 1270 Display.runDeferredEvents() line: 3971 Display.readAndDispatch() line: 3610 Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 2696 Workbench.runUI() line: 2660 Workbench.access$4(Workbench) line: 2494 Workbench$7.run() line: 674 Realm.runWithDefault(Realm, Runnable) line: 332 Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 667 PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 149 IDEApplication.start(IApplicationContext) line: 123 EclipseAppHandle.run(Object) line: 196 EclipseAppLauncher.runApplication(Object) line: 110 EclipseAppLauncher.start(Object) line: 79 EclipseStarter.run(Object) line: 344 EclipseStarter.run(String[], Runnable) line: 179 NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39 DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25 Method.invoke(Object, Object...) line: 597 Main.invokeFramework(String[], URL[]) line: 622 Main.basicRun(String[]) line: 577 Main.run(String[]) line: 1410 Main.main(String[]) line: 1386
Created attachment 203101 [details] Fix for NPE This patch fixes the issue.
The patch looks good. Would you be able to add a test case along with the change? It's also greatly appreciated if you attach contexts along with patches. It helps to identify the relevant code parts more quickly. Thanks!
I was afraid you were going to ask me that. :) It showed up as a result of a sort of random case, I'm not even sure that it happens consistently. It would take quite a bit of time to try to set up a test UI case with the quick content manager and so on. Perhaps we could just treat it as fixing a common API usage issue? (I don't have a separate context as I just made a quick change to this one file.)
Shawn, I'll leave it up to you to merge the patch with or without a test case.
I have applied the patch. Thanks Miles!