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

Bug 311853

Summary: [Perspectives] [Min/Max] Maximize and Minimizing views causes nullpointer exception
Product: [Eclipse Project] Platform Reporter: Johan Asterholm <johan.asterholm>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: VERIFIED FIXED QA Contact: Eric Moffatt <emoffatt>
Severity: normal    
Priority: P3 CC: pwebster, remy.suen
Version: 3.6Flags: remy.suen: review+
pwebster: review+
Target Milestone: 3.6 RC2   
Hardware: PC   
OS: Windows All   
Whiteboard:
Attachments:
Description Flags
Patch that closes any open FV before deactivating the perspective none

Description Johan Asterholm CLA 2010-05-06 07:01:45 EDT
Build Identifier: I20100429-1549

A nullpointer is recived when maximizing views and switching perspective.
This could be related to ticket 201293 which was solved in 3.4

java.lang.NullPointerException
at org.eclipse.ui.internal.PartStack.smartUnzoom(PartStack.java:1407)
at org.eclipse.ui.internal.PartStack$3.runWithException(PartStack.java:1478)
at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)
at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:179)
at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150)
at org.eclipse.swt.widgets.Display.syncExec(Display.java:4584)
at org.eclipse.ui.internal.StartupThreading.runWithoutExceptions(StartupThreading.java:94)
at org.eclipse.ui.internal.PartStack.setState(PartStack.java:1471)
at org.eclipse.ui.internal.PerspectiveHelper.zoomOut(PerspectiveHelper.java:1430)
at org.eclipse.ui.internal.Perspective.setActiveFastView(Perspective.java:1931)
at org.eclipse.ui.internal.Perspective.setActiveFastView(Perspective.java:1952)
at org.eclipse.ui.internal.Perspective.onDeactivate(Perspective.java:1120)
at org.eclipse.ui.internal.WorkbenchPage.setPerspective(WorkbenchPage.java:3605)
at org.eclipse.ui.internal.WorkbenchPage.busySetPerspective(WorkbenchPage.java:1041)
at org.eclipse.ui.internal.WorkbenchPage.access$16(WorkbenchPage.java:1025)
at org.eclipse.ui.internal.WorkbenchPage$19.run(WorkbenchPage.java:3715)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.internal.WorkbenchPage.setPerspective(WorkbenchPage.java:3713)
at org.eclipse.ui.internal.PerspectiveBarContributionItem.select(PerspectiveBarContributionItem.java:124)
at org.eclipse.ui.internal.PerspectiveBarContributionItem$1.widgetSelected(PerspectiveBarContributionItem.java:93)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2601)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2565)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2399)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:669)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:662)
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(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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)


Reproducible: Always

Steps to Reproduce:
1. open java perspective
2. maximise a view
3. click on one of the icons on the side to show another view.
4. maximise this one.
5. open another perspective.
Comment 1 Remy Suen CLA 2010-05-06 07:15:02 EDT
(In reply to comment #0)
> 1. open java perspective
> 2. maximise a view
> 3. click on one of the icons on the side to show another view.
> 4. maximise this one.
> 5. open another perspective.

Could not reproduce with I20100429-1549 on Windows XP. This is what I tried.

1. Start Eclipse on a new workspace.
2. Close the 'Welcome' view.
3. Select the 'Package Explorer'.
4. Ctrl+M to maximize it.
5. Select the 'Javadoc' view at the bottom right hand corner.
6. Ctrl+M to maximize it.
7. Window > Open Perspective > Debug
8. Nothing in the error log.
Comment 2 Johan Asterholm CLA 2010-05-06 07:22:45 EDT
(In reply to comment #1)
> (In reply to comment #0)
> > 1. open java perspective
> > 2. maximise a view
> > 3. click on one of the icons on the side to show another view.
> > 4. maximise this one.
> > 5. open another perspective.
> 
> Could not reproduce with I20100429-1549 on Windows XP. This is what I tried.
> 
> 1. Start Eclipse on a new workspace.
> 2. Close the 'Welcome' view.
> 3. Select the 'Package Explorer'.
> 4. Ctrl+M to maximize it.
> 5. Select the 'Javadoc' view at the bottom right hand corner.
> 6. Ctrl+M to maximize it.
> 7. Window > Open Perspective > Debug
> 8. Nothing in the error log.

The problem seems to work fine when using Ctrl+M. But recreatable when using the icons to maximize.
Comment 3 Remy Suen CLA 2010-05-06 07:27:43 EDT
(In reply to comment #2)
> The problem seems to work fine when using Ctrl+M. But recreatable when using
> the icons to maximize.

By icons I presume you mean by double-clicking the tab, yes? I can reproduce
the problem by double-clicking the tab. The only way to get out of this state
that I can see is to reset the perspective.
Comment 4 Johan Asterholm CLA 2010-05-06 07:29:24 EDT
(In reply to comment #3)
> (In reply to comment #2)
> > The problem seems to work fine when using Ctrl+M. But recreatable when using
> > the icons to maximize.
> 
> By icons I presume you mean by double-clicking the tab, yes? I can reproduce
> the problem by double-clicking the tab. The only way to get out of this state
> that I can see is to reset the perspective.

Ether double clicking the tab, or pressing maximum button reproduces it for me.
Comment 5 Remy Suen CLA 2010-05-06 07:32:29 EDT
(In reply to comment #4)
> Ether double clicking the tab, or pressing maximum button reproduces it for me.

Ah okay, you were talking about the button in the top right part of a given tab (folder).
Comment 6 Eric Moffatt CLA 2010-05-17 16:32:34 EDT
Dang, I thought I'd covered this one. The fix appears to be to move the 'setActiveFastView(null)' in Perspective#deactivate() above 'presentation.deactivate()' to ensure that there's no fast view open when de-activating the presentation...patch coming.
Comment 7 Eric Moffatt CLA 2010-05-18 09:03:34 EDT
Created attachment 168919 [details]
Patch that closes any open FV before deactivating the perspective


Also contains a fix that was causing the originally maximized view (in the real presentation) to become unmaximized.
Comment 8 Paul Webster CLA 2010-05-18 10:23:35 EDT
(In reply to comment #7)
> Created an attachment (id=168919) [details]
> Patch that closes any open FV before deactivating the perspective

+1 I've tested scenarios with views and fastviews from the trim, and the problem has been fixed.

PW
Comment 9 Remy Suen CLA 2010-05-18 10:40:20 EDT
(In reply to comment #7)
> Created an attachment (id=168919) [details]
> Patch that closes any open FV before deactivating the perspective

+1, the problem is fixed on Windows XP and the tests are green on my computer.
Comment 10 Eric Moffatt CLA 2010-05-19 08:32:13 EDT
Committed in >20100519. Applied the patch.
Comment 11 Eric Moffatt CLA 2010-05-21 14:09:06 EDT
Fixed.
Comment 12 Eric Moffatt CLA 2010-05-21 14:09:25 EDT
Verified in I20100520-1744.