Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 357299

Summary: NPE when removing an item from quick context page in task editor.
Product: z_Archived Reporter: Miles Parker <milesparker>
Component: MylynAssignee: Miles Parker <milesparker>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: shawn.minto
Version: unspecifiedKeywords: contributed
Target Milestone: 3.7   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Fix for NPE none

Description Miles Parker CLA 2011-09-09 21:43:22 EDT
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
Comment 1 Miles Parker CLA 2011-09-09 21:44:30 EDT
Created attachment 203101 [details]
Fix for NPE

This patch fixes the issue.
Comment 2 Steffen Pingel CLA 2011-09-12 12:54:03 EDT
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!
Comment 3 Miles Parker CLA 2011-09-12 13:21:21 EDT
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.)
Comment 4 Steffen Pingel CLA 2011-09-22 07:12:10 EDT
Shawn, I'll leave it up to you to merge the patch with or without a test case.
Comment 5 Steffen Pingel CLA 2012-02-17 05:50:54 EST
I have applied the patch. Thanks Miles!