Community
Participate
Working Groups
I20121113-0800 - new workspace - close Welcome - click into Package Explorer (bug 394394) - paste this: package p; public class C { public static void main(String[] args) { int i= 2; System.out.println(i); } } - click Maximize button of editor - click Minimize button of editor => editor area is gone - clicking Maximize, Restore in the Outline brings the editor back - when I click Maximize, Minimize in the Package Explorer while the editor area is gone, I sometimes get this NPE: !ENTRY org.eclipse.equinox.event 4 0 2012-11-15 16:25:48.542 !MESSAGE Exception while dispatching event org.osgi.service.event.Event [topic=org/eclipse/e4/ui/model/application/ApplicationElement/tags/REMOVE] to handler org.eclipse.e4.ui.services.internal.events.UIEventHandler@ca1b35 !STACK 0 java.lang.NullPointerException at org.eclipse.e4.ui.workbench.addons.minmax.MinMaxAddon.restore(MinMaxAddon.java:578) at org.eclipse.e4.ui.workbench.addons.minmax.MinMaxAddon$8.handleEvent(MinMaxAddon.java:395) at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:41) at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180) at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150) at org.eclipse.swt.widgets.Display.syncExec(Display.java:4687) at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:187) at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:38) at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197) at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197) at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135) at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78) at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39) at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:81) at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:58) at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374) at org.eclipse.emf.ecore.util.EcoreEList.dispatchNotification(EcoreEList.java:249) at org.eclipse.emf.common.notify.impl.NotifyingListImpl.remove(NotifyingListImpl.java:725) at org.eclipse.emf.common.util.AbstractEList.remove(AbstractEList.java:460) at org.eclipse.e4.ui.workbench.addons.minmax.MinMaxAddon.unzoom(MinMaxAddon.java:742) at org.eclipse.e4.ui.workbench.addons.minmax.MinMaxAddon$8.handleEvent(MinMaxAddon.java:397) at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:41) at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180) at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150) at org.eclipse.swt.widgets.Display.syncExec(Display.java:4687) at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:187) at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:38) at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197) at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197) at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135) at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78) at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39) at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:81) at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:58) at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374) at org.eclipse.emf.ecore.util.EcoreEList.dispatchNotification(EcoreEList.java:249) at org.eclipse.emf.common.notify.impl.NotifyingListImpl.remove(NotifyingListImpl.java:725) at org.eclipse.emf.common.util.AbstractEList.remove(AbstractEList.java:460) at org.eclipse.e4.ui.workbench.addons.minmax.MinMaxAddon.setState(MinMaxAddon.java:280) at org.eclipse.e4.ui.workbench.addons.minmax.MinMaxAddon.access$2(MinMaxAddon.java:270) at org.eclipse.e4.ui.workbench.addons.minmax.MinMaxAddon$3.restore(MinMaxAddon.java:177) at org.eclipse.swt.custom.CTabFolder.onSelection(CTabFolder.java:2024) at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:285) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1026) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:915) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:79) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:587) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:542) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124) 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:353) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584) at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
I can repro this except for the exception you're seeing...can you provide any more details ?
Sorry, the right steps for the NPE are: - follow comment 0 until "=> editor area is gone" - click Maximize, Restore (not Minimize) in the Package Explorer Note that there are a few other bugs about an NPE in MinMaxAddon.restore, but I wasn't sure if that part is a dup or if it can only happens after the editor area disappeared.
I wasn't able to reproduce the NPE, but I can reproduce everything else. In addition, if you open a new file, the editor area still thinks it is maximized (minimized?) and only provides a restore option. When you click restore nothing happens.
Using the steps in bug 400048 the editor area disappears and I get a grey square on top of my eclipse. PW
(In reply to comment #4) > Using the steps in bug 400048 the editor area disappears and I get a grey > square on top of my eclipse. On further inspection bug 400048 is not the same bug. Launch Eclipse with a new workspace (as it will become unusable in a few minutes) In the Resource perspective, create a new Project Create a new File (test1.txt) Create a new File (test2.txt) Double click on the editor tab for test1.txt to maximize it Click the minimize icon on the editor toolbar > Now you have a problem, because the editors did not go back to their correct location -- using the Restore button in the editor toolbar has no affect -- closing the editors leaves an unusable area on the screen that cannot be recovered (see screen capture) -- Reset Perspective has no affect -- sometimes restarting the workspace seems to get things working again (though not always) -- sometimes the NPE below can be found in the Error Log (though not always)
I've pushed the fix for this to Gerrit: https://git.eclipse.org/r/13029 What happens is (starting with the maximized EA): 1) Hit Minimize: This automatically causes an unzoom, meaning that all the elements in the trim restore to the main presentation. * The side effect of this is that the trim has no more visible children causing the CleanupAddon to asynch some code to set the TBR of the trim to false. 2) The EA goes minimized, causing it to add the EA's TrimStack to the trim. Now, the asynch fires and sets the TBR on the *trim* to false...boom, no minimized EA. Fix if very simple...recheck in the asynch to ensure that there are *still* no visible children.
I got into one state with https://git.eclipse.org/r/13029 where the editor area was both in the trim and displayed in its regular location on startup. The first click into an editor would 1) move it and expand it as if it was minimized and 2) leave a grey blank area where the editor area used to be (so the space was not reclaimed). I haven't been able to create a reproducible test case though. PW
I don't see how this could possibly have been introduced by changing the CleanupAddon to recheck before doing something obviously wrong. I'm guessing that there are other fixes in the MinMaxAddon that haven't been back-ported to 4.2.2. As a first pass we could try to see what we get using the *current* MinMaxAddon code + the patch. If this works then we can either go with it or use the history to cherry-pick the other needed fixes...
Tried out Eric's fix and had no issues.
Paul, ant status here ? Unless we can get a handle on what happened on your box I can't see this as being a bad fix...
(In reply to comment #7) > I got into one state with https://git.eclipse.org/r/13029 I have not run into the problem again, and this fixes the issue. The Gerrit patch is targetted at master, so it'll need to be cherry-picked for R4_2_maintenance PW
Paul, what's the status of this. It's not marked fixed but the code seems to be in both R4_3_maintenance and master... Not really sure if it's in 4.2.2 (or even if it needs to be).
Fixed by Bug 410828 PW
Verified in the build: I20130805-2000
*** Bug 403760 has been marked as a duplicate of this bug. ***
*** Bug 406926 has been marked as a duplicate of this bug. ***