Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 328944 - [Compatibility] Potentially recursive NPEs thrown after 'Synchronize' view has been closed and reopened
Summary: [Compatibility] Potentially recursive NPEs thrown after 'Synchronize' view ha...
Status: RESOLVED FIXED
Alias: None
Product: e4
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 1.0   Edit
Hardware: All All
: P3 critical (vote)
Target Milestone: 4.1 M4   Edit
Assignee: Remy Suen CLA
QA Contact: Remy Suen CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-28 12:41 EDT by Remy Suen CLA
Modified: 2010-11-01 11:09 EDT (History)
0 users

See Also:


Attachments
WorkbenchPartReference patch v1 (1.50 KB, patch)
2010-10-28 13:55 EDT, Remy Suen CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Remy Suen CLA 2010-10-28 12:41:26 EDT
Confirmed on I20101022-1046 and I20101028-1046.

1. Make changes to a project under version control.
2. Synchronize and switch perspectives.
3. Close the 'Synchronize' view
4. Reopen it.
5. Trying to activate another view will now cause NPEs.
6. Close the 'Synchronize' view. It should be the active view so clicking the 'X' should be okay.
7. If you reopen the view you are okay again.

Unfortunately, the workaround is non-obvious.

Caused by: java.lang.NullPointerException
at org.eclipse.ui.part.PageBookView$4.partDeactivated(PageBookView.java:1047)
at org.eclipse.ui.internal.WorkbenchPage.firePartDeactivated(WorkbenchPage.java:3054)
at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:3043)
at org.eclipse.ui.internal.WorkbenchPage$E4PartListener.partDeactivated(WorkbenchPage.java:142)
at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.firePartDeactivated(PartServiceImpl.java:173)
at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.setPart(PartServiceImpl.java:140)
at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:52)
... 91 more
Comment 1 Remy Suen CLA 2010-10-28 13:55:37 EDT
Created attachment 181971 [details]
WorkbenchPartReference patch v1

(In reply to comment #0)
> 1. Make changes to a project under version control.
> 2. Synchronize and switch perspectives.
> 3. Close the 'Synchronize' view
> 4. Reopen it.
> 5. Trying to activate another view will now cause NPEs.
> 6. Close the 'Synchronize' view. It should be the active view so clicking the
> 'X' should be okay.
> 7. If you reopen the view you are okay again.

To reproduce the problem in my inner, I had to open one of the edited files from the 'Synchronize' view before proceeding onward with step 3.

The stack trace below shows the problem where our part reference ends up pointing at the workbench part that's currently being _deconstructed_ due to the how a part's 'object' is the last feature to be unset in the teardown process.

Thread [main] (Suspended (breakpoint at line 452 in WorkbenchPartReference))	
	ViewReference(WorkbenchPartReference).getPart(boolean) line: 452	
	WorkbenchPage.findPart(IWorkbenchPart) line: 535	
	WorkbenchPage.isPartVisible(IWorkbenchPart) line: 2053	
	ExtendedMarkersView$ViewerPageSelectionListener.selectionChanged(IWorkbenchPart, ISelection) line: 1653	
	SelectionService.notifyListeners(String, IWorkbenchPart, ISelection) line: 133	
	SelectionService.access$3(SelectionService, String, IWorkbenchPart, ISelection) line: 131	
	SelectionService$1.selectionChanged(MPart, Object) line: 71	
	SelectionServiceImpl.notifyListeners(MPart, Object) line: 196	
	SelectionServiceImpl.access$4(SelectionServiceImpl, MPart, Object) line: 191	
	SelectionServiceImpl$2.changed(IEclipseContext) line: 234	
	TrackableComputationExt.update(ContextChangeEvent) line: 95	
	EclipseContext.processScheduled(List<Scheduled>) line: 326	
	EclipseContext.set(String, Object) line: 343	
	EclipseContext.dispose() line: 197	
	PageSite.dispose() line: 150	
	SynchronizeView(PageBookView).removePage(PageBookView$PageRec) line: 867	
	SynchronizeView(PageBookView).dispose() line: 518	
	SynchronizeView.dispose() line: 282	
	CompatibilityView(CompatibilityPart).invalidate() line: 116	
	CompatibilityView(CompatibilityPart).destroy() line: 223	
	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 79	
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43	
	Method.invoke(Object, Object...) line: 618	
	MethodRequestor.execute() line: 52	
	InjectorImpl.processAnnotated(Class<Annotation>, Object, Class<?>, PrimaryObjectSupplier, PrimaryObjectSupplier, ArrayList<Class<?>>) line: 796	
	InjectorImpl.processAnnotated(Class<Annotation>, Object, Class<?>, PrimaryObjectSupplier, PrimaryObjectSupplier, ArrayList<Class<?>>) line: 776	
	InjectorImpl.uninject(Object, PrimaryObjectSupplier) line: 163	
	FieldRequestor(Requestor).uninject(Object, PrimaryObjectSupplier) line: 122	
	ContextObjectSupplier$ContextInjectionListener.update(IEclipseContext, int, Object[]) line: 69	
	TrackableComputationExt.update(ContextChangeEvent) line: 90	
	EclipseContext.removeListenersTo(Object) line: 437	
	ContextInjectionFactory.uninject(Object, IEclipseContext) line: 134	
	PartRenderingEngine.safeRemoveGui(MUIElement) line: 634	
	PartRenderingEngine.access$1(PartRenderingEngine, MUIElement) line: 592	
	PartRenderingEngine$5.run() line: 587	
	SafeRunner.run(ISafeRunnable) line: 42	
	PartRenderingEngine.removeGui(MUIElement) line: 573	
	ElementReferenceRenderer.disposeWidget(MUIElement) line: 108	
	PartRenderingEngine.safeRemoveGui(MUIElement) line: 629	
	PartRenderingEngine.access$1(PartRenderingEngine, MUIElement) line: 592	
	PartRenderingEngine$5.run() line: 587	
	SafeRunner.run(ISafeRunnable) line: 42	
	PartRenderingEngine.removeGui(MUIElement) line: 573	
	PartRenderingEngine$1.handleEvent(Event) line: 134	
	UIEventHandler.handleEvent(Event) line: 41	
	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: 73	
	UIEventPublisher.notifyChanged(Notification) line: 58	
	PlaceholderImpl(BasicNotifierImpl).eNotify(Notification) line: 380	
	PlaceholderImpl(UIElementImpl).setToBeRendered(boolean) line: 288	
	PartServiceImpl.hidePart(MPart, boolean) line: 882	
	PartServiceImpl.hidePart(MPart) line: 832
Comment 2 Remy Suen CLA 2010-11-01 11:09:26 EDT
(In reply to comment #1)
> Created an attachment (id=181971) [details]
> WorkbenchPartReference patch v1

Patch released to CVS HEAD.