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

Bug 317466

Summary: NPE when minimizing a view that's previously been detached
Product: [Eclipse Project] e4 Reporter: Remy Suen <remy.suen>
Component: UIAssignee: Project Inbox <e4.ui-inbox>
Status: RESOLVED WORKSFORME QA Contact: Eric Moffatt <emoffatt>
Severity: normal    
Priority: P3 CC: susan
Version: 1.0   
Target Milestone: 1.0 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Remy Suen CLA 2010-06-21 10:39:34 EDT
1. Open a file.
2. Drag the 'Problems' view to the 'Outline' view's stack.
3. Detach the 'Problems' view.
4. Detach the 'Outline' view to the 'Problems' view's stack.
5. Minimize that stack.
6. Restore it.
7. Bring the 'Outline' view back to its place, right of the editor area.
8. Minimize it.
9. An NPE is thrown.

org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException)
	at org.eclipse.swt.SWT.error(SWT.java:4083)
	at org.eclipse.swt.SWT.error(SWT.java:3998)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:137)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4041)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:650)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:578)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:102)
	at org.eclipse.ui.internal.Workbench$3.run(Workbench.java:537)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:521)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
Caused by: java.lang.NullPointerException
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:152)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:86)
	at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:205)
	at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:224)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:357)
	at org.eclipse.e4.ui.internal.workbench.swt.AbstractPartRenderer.activate(AbstractPartRenderer.java:105)
	at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer$ActivationJob.run(StackRenderer.java:89)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
	... 23 more
Comment 1 Remy Suen CLA 2010-06-21 11:44:55 EDT
Simpler steps as follows:

1. Open a file.
2. Detach the 'Outline' view.
3. Bring it back to the right of the editor.
4. Minimize the 'Outline' view.
5. Restore the 'Outline' view.
6. An NPE is thrown.
Comment 2 Remy Suen CLA 2010-06-21 12:49:12 EDT
I should also note that when you minimize the view, its icon does not show up in the trim. You only get the 'Restore' icon in the trim.
Comment 3 Eric Moffatt CLA 2010-06-22 14:48:58 EDT
This is almost certainly a failure in the DnD system to detect that the drop area is an *Editor Stack* (i.e. it's already a SharedElement itself) and seems to be running into issues hosting a view.
Comment 4 Susan McCourt CLA 2010-07-19 16:17:17 EDT
changing milestone to a future one
Comment 5 Susan McCourt CLA 2010-07-19 16:28:50 EDT
Win7, Build id: I20100718-2237

I tried the steps to see where we are on this bug.

1. Open a file.
2. Detach the 'Outline' view.
3. Bring it back to the right of the editor.
4. Minimize the 'Outline' view.
5. Restore the 'Outline' view.
6. An NPE is thrown.

I don't see an NPE when restoring the outline view in step 6.
However when I minimize the outline view in step 4, it behaves as a fast view...it floats on top of the upper right quadrant of the editor.
Comment 6 Susan McCourt CLA 2010-07-19 16:31:32 EDT
(In reply to comment #5)
> Win7, Build id: I20100718-2237
> 
> I tried the steps to see where we are on this bug.
> 
> 1. Open a file.
> 2. Detach the 'Outline' view.
> 3. Bring it back to the right of the editor.
> 4. Minimize the 'Outline' view.
> 5. Restore the 'Outline' view.
> 6. An NPE is thrown.
> 
> I don't see an NPE when restoring the outline view in step 6.
> However when I minimize the outline view in step 4, it behaves as a fast
> view...it floats on top of the upper right quadrant of the editor.

I think this latter problem is already described in bug 315807.

So I think this bug is fixed and that one is not.
(But I'll let Remy say for sure).
Comment 7 Remy Suen CLA 2010-07-19 16:59:50 EDT
(In reply to comment #6)
> I think this latter problem is already described in bug 315807.

Yes, that's the "eager" activation bug.

> So I think this bug is fixed and that one is not.
> (But I'll let Remy say for sure).

Cannot reproduce anymore, marking as WORKSFORME.
Comment 8 Susan McCourt CLA 2010-07-19 17:03:38 EDT
changing milestone (since we noticed it working in RC2)