Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 377837 - NPE on CTF tab switch
Summary: NPE on CTF tab switch
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 4.2 M7   Edit
Assignee: Brian de Alwis CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-26 17:50 EDT by Brian de Alwis CLA
Modified: 2012-05-01 17:05 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brian de Alwis CLA 2012-04-26 17:50:26 EDT
I seem occasional NPEs when switching tabs to an as-yet unopened part:

	if (item != null) {
		MUIElement ele = (MUIElement) item.getData(OWNING_ME);
		if (ele.getParent().getSelectedElement() == ele) {
			Control ctrl = (Control) ele.getWidget();
			ctrl.setFocus();
		}
	}

Checking that ctrl != null avoids the issue.

java.lang.NullPointerException:
	StackRenderer$8.mouseUp(MouseEvent) line: 878	
	TypedListener.handleEvent(Event) line: 220	
	EventTable.sendEvent(Event) line: 84	
	Display.sendEvent(EventTable, Event) line: 4130	
	CTabFolder(Widget).sendEvent(Event) line: 1457	
	CTabFolder(Widget).sendEvent(int, Event, boolean) line: 1480	
	CTabFolder(Widget).sendEvent(int, Event) line: 1465	
	CTabFolder(Widget).notifyListeners(int, Event) line: 1270	
	Display.runDeferredEvents() line: 3976	
	Display.readAndDispatch() line: 3615	
	WorkbenchPage.firePartOpened(CompatibilityPart) line: 4365	
	CompatibilityPart$2.handleEvent(Event) line: 110	
	UIEventHandler$1.run() line: 41	
	UISynchronizer(Synchronizer).syncExec(Runnable) line: 180	
	UISynchronizer.syncExec(Runnable) line: 150	
	Display.syncExec(Runnable) line: 4597	
	E4Application$1.syncExec(Runnable) line: 185	
	UIEventHandler.handleEvent(Event) line: 38	
	EventHandlerWrapper.handleEvent(Event, Permission) line: 197	
	EventHandlerTracker.dispatchEvent(EventHandlerWrapper, Permission, int, Event) line: 197	
	EventHandlerTracker.dispatchEvent(Object, Object, int, Object) line: 1	
	EventManager.dispatchEvent(Set, EventDispatcher, int, Object) line: 230	
	ListenerQueue.dispatchEventSynchronous(int, Object) line: 148	
	EventAdminImpl.dispatchEvent(Event, boolean) line: 135	
	EventAdminImpl.sendEvent(Event) line: 78	
	EventComponent.sendEvent(Event) line: 39	
	EventBroker.send(String, Object) line: 81	
	UIEventPublisher.notifyChanged(Notification) line: 57	
	PartImpl(BasicNotifierImpl).eNotify(Notification) line: 374	
	PartImpl.setObject(Object) line: 378	
	ContributedPartRenderer.createWidget(MUIElement, Object) line: 143	
	PartRenderingEngine.createWidget(MUIElement, Object) line: 883	
	PartRenderingEngine.safeCreateGui(MUIElement, Object, IEclipseContext) line: 617	
	PartRenderingEngine$6.run() line: 506	
	SafeRunner.run(ISafeRunnable) line: 42	
	PartRenderingEngine.createGui(MUIElement, Object, IEclipseContext) line: 491	
	ElementReferenceRenderer.createWidget(MUIElement, Object) line: 74	
	PartRenderingEngine.createWidget(MUIElement, Object) line: 883	
	PartRenderingEngine.safeCreateGui(MUIElement, Object, IEclipseContext) line: 617	
	PartRenderingEngine.safeCreateGui(MUIElement) line: 719	
	PartRenderingEngine.access$2(PartRenderingEngine, MUIElement) line: 690	
	PartRenderingEngine$7.run() line: 684	
	SafeRunner.run(ISafeRunnable) line: 42	
	PartRenderingEngine.createGui(MUIElement) line: 669	
	PartServiceImpl$1.handleEvent(Event) line: 95	
	UIEventHandler$1.run() line: 41	
	UISynchronizer(Synchronizer).syncExec(Runnable) line: 180	
	UISynchronizer.syncExec(Runnable) line: 150	
	Display.syncExec(Runnable) line: 4597	
	E4Application$1.syncExec(Runnable) line: 185	
	UIEventHandler.handleEvent(Event) line: 38	
	EventHandlerWrapper.handleEvent(Event, Permission) line: 197	
	EventHandlerTracker.dispatchEvent(EventHandlerWrapper, Permission, int, Event) line: 197	
	EventHandlerTracker.dispatchEvent(Object, Object, int, Object) line: 1	
	EventManager.dispatchEvent(Set, EventDispatcher, int, Object) line: 230	
	ListenerQueue.dispatchEventSynchronous(int, Object) line: 148	
	EventAdminImpl.dispatchEvent(Event, boolean) line: 135	
	EventAdminImpl.sendEvent(Event) line: 78	
	EventComponent.sendEvent(Event) line: 39	
	EventBroker.send(String, Object) line: 81	
	UIEventPublisher.notifyChanged(Notification) line: 57	
	PartStackImpl(BasicNotifierImpl).eNotify(Notification) line: 374	
	PartStackImpl(ElementContainerImpl<T>).setSelectedElement(T) line: 171	
	StackRenderer$7.widgetSelected(SelectionEvent) line: 848	
	TypedListener.handleEvent(Event) line: 248	
	EventTable.sendEvent(Event) line: 84	
	Display.sendEvent(EventTable, Event) line: 4130	
	CTabFolder(Widget).sendEvent(Event) line: 1457	
	CTabFolder(Widget).sendEvent(int, Event, boolean) line: 1480	
	CTabFolder(Widget).sendEvent(int, Event) line: 1465	
	CTabFolder(Widget).notifyListeners(int, Event) line: 1270	
	CTabFolder.setSelection(int, boolean) line: 3025	
	CTabFolder.onMouse(Event) line: 1731	
	CTabFolder$1.handleEvent(Event) line: 270	
	EventTable.sendEvent(Event) line: 84	
	Display.sendEvent(EventTable, Event) line: 4130	
	CTabFolder(Widget).sendEvent(Event) line: 1457	
	CTabFolder(Widget).sendEvent(int, Event, boolean) line: 1480	
	CTabFolder(Widget).sendEvent(int, Event) line: 1465	
	CTabFolder(Widget).notifyListeners(int, Event) line: 1270	
	Display.runDeferredEvents() line: 3976	
	Display.readAndDispatch() line: 3615	
	PartRenderingEngine$9.run() line: 1016	
	Realm.runWithDefault(Realm, Runnable) line: 332	
	PartRenderingEngine.run(MApplicationElement, IEclipseContext) line: 910	
	E4Workbench.createAndRunUI(MApplicationElement) line: 86	
	Workbench$4.run() line: 582	
	Realm.runWithDefault(Realm, Runnable) line: 332	
	Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 537	
	PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 149	
	IDEApplication.start(IApplicationContext) line: 124	
	EclipseAppHandle.run(Object) line: 196	
	EclipseAppLauncher.runApplication(Object) line: 110	
	EclipseAppLauncher.start(Object) line: 79	
	EclipseStarter.run(Object) line: 353	
	EclipseStarter.run(String[], Runnable) line: 180	
	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: 629	
	Main.basicRun(String[]) line: 584	
	Main.run(String[]) line: 1438	
	Main.main(String[]) line: 1414
Comment 1 Brian de Alwis CLA 2012-04-26 17:52:52 EDT
Fix committed to master (e503bef48d1931fa08df2ca7439a416c223b10de)
Comment 2 Paul Webster CLA 2012-04-27 07:42:39 EDT
Brian, see bug 375576 comment #20

We might need to do something else here.

PW
Comment 3 Brian de Alwis CLA 2012-04-27 08:02:27 EDT
(In reply to comment #2)
> Brian, see bug 375576 comment #20
> 
> We might need to do something else here.

It sounds like Eric was hitting the same issue as I was — my commit was put in an hour after his post.
Comment 4 Brian de Alwis CLA 2012-05-01 17:05:42 EDT
Verified in I20120430-1800