DESCRIPTION

Bug 457939 - set the curSharedRef of MPlaceholder to null when it is
removed from the GUI

Change-Id: Ic691ca1bc85a0cb311db29ebdda84d0887f7e873
Signed-off-by: Myah Faulkner xxx@xxx.xxx


COMMENTS

author: Brenden Conley
date: 2015-02-20 13:56:00.000000000

Patch Set 3:

Build Started https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/4645/

-------------------------------------
author: Brenden Conley
date: 2015-02-20 14:16:49.000000000

Patch Set 3: Verified+1

Build Successful 

https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/4645/ : SUCCESS

-------------------------------------
author: Teagan Marsh
date: 2015-03-24 21:24:27.000000000

Patch Set 3: Code-Review-1

I don't think this is right: I get NPEs when closing the intro:

Thread [main] (Suspended (exception NullPointerException))	
	WorkLeon OchoachIntroManager.getIntroStack(ViewIntroAdapterPart) line: 204	
	WorkLeon OchoachIntroManager.isIntroMaximized(ViewIntroAdapterPart) line: 212	
	WorkLeon OchoachIntroManager.isIntroStandby(IIntroPart) line: 230	
	IntroPlugin.isIntroStandby() line: 141	
	CustomizableIntroPart.setFocus() line: 321	
	ViewIntroAdapterPart.setFocus() line: 209	
	CompatibilityView(CompatibilityPart).delegateSetFocus() line: 199	
	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 62	
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43	
	Method.invoke(Object, Object...) line: 483	
	MethodRequestor.execute() line: 55	
	InjectorImpl.invokeUsingClass(Object, Class<?>, Class<Annotation>, Object, PrimaryObjectSupplier, PrimaryObjectSupplier, boolean) line: 247	
	InjectorImpl.invokeUsingClass(Object, Class<?>, Class<Annotation>, Object, PrimaryObjectSupplier, PrimaryObjectSupplier, boolean) line: 253	
	InjectorImpl.invoke(Object, Class<Annotation>, Object, PrimaryObjectSupplier) line: 225	
	ContextInjectionFactory.invoke(Object, Class<Annotation>, IEclipseContext, Object) line: 107	
	PartRenderingEngine.focusGui(MUIElement) line: 755	
	ContributedPartRenderer$2.setFocus() line: 101	
	Composite.setFocus() line: 1037	
	CTabItem.setFocus() line: 332	
	CTabFolder.setFocus() line: 2555	
	Composite(Control).fixFocus(Control) line: 1351	
	Composite(Control).setVisible(boolean) line: 4291	
	CTabItem.setControl(Control) line: 290	
	StackRenderer.hideChild(MElementContainer<MUIElement>, MUIElement) line: 997	
	PartRenderingEngine.safeRemoveGui(MUIElement) line: 832	
	PartRenderingEngine.access$1(PartRenderingEngine, MUIElement) line: 822	
	PartRenderingEngine$3.run() line: 817	
	SafeRunner.run(ISafeRunnable) line: 42	
	PartRenderingEngine.removeGui(MUIElement) line: 801	
	PartRenderingEngine.subscribeTopicToBeRendered(Event) line: 157	
	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 62	
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43	
	Method.invoke(Object, Object...) line: 483	
	MethodRequestor.execute() line: 55	
	EventObjectSupplier$DIEventHandler.handleEvent(Event) line: 83	
	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<Entry<K,V>>, EventDispatcher<K,V,E>, int, E) line: 230	
	ListenerQueue<K,V,E>.dispatchEventSynchronous(int, E) line: 148	
	EventAdminImpl.dispatchEvent(Event, boolean) line: 135	
	EventAdminImpl.sendEvent(Event) line: 78	
	EventComponent.sendEvent(Event) line: 39	
	EventBroker.send(String, Object) line: 85	
	UIEventPublisher.notifyChanged(Notification) line: 59	
	PlaceholderImpl(BasicNotifierImpl).eNotify(Notification) line: 374	
	PlaceholderImpl(UIElementImpl).setToBeRendered(boolean) line: 303	
	PartServiceImpl.hidePart(MPart, boolean) line: 1287	
	PartServiceImpl.hidePart(MPart) line: 1221	
	StackRenderer.closePart(Widget, boolean) line: 1276	
	StackRenderer.access$4(StackRenderer, Widget, boolean) line: 1258	
	StackRenderer$11.close(CTabFolderEvent) line: 1143	
	CTabFolder.onMouse(Event) line: 1874	
	CTabFolder$1.handleEvent(Event) line: 288	
	EventTable.sendEvent(Event) line: 84	
	Display.sendEvent(EventTable, Event) line: 4203	
	CTabFolder(Widget).sendEvent(Event) line: 1467	
	CTabFolder(Widget).sendEvent(int, Event, boolean) line: 1490	
	CTabFolder(Widget).sendEvent(int, Event) line: 1475	
	CTabFolder(Widget).notifyListeners(int, Event) line: 1279	
	Display.runDeferredEvents() line: 4045	
	Display.readAndDispatch() line: 3672	
	PartRenderingEngine$4.run() line: 1118	
	Realm.runWithDefault(Realm, Runnable) line: 337

-------------------------------------
author: Myah Faulkner
date: 2015-03-24 21:40:11.000000000

Patch Set 3:

Well, the question is, is my patch wrong, or is the code in WorkLeon OchoachIntroManager not correct.

The line that throws the exception is:
MUIElement introPartParent = introModelPart.getCurSharedRef().getParent();

So it assumes that curSharedRef is never null. Not even if it is closed. And it is checked when the intro is closed.

IMHO the line of code there needs to be null safe, since the NPE comes up on closing. :)

-------------------------------------
