Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 317887 - NPE when switching perspectives
Summary: NPE when switching perspectives
Status: RESOLVED WORKSFORME
Alias: None
Product: e4
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-24 17:57 EDT by Remy Suen CLA
Modified: 2019-06-05 07:47 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Remy Suen CLA 2010-06-24 17:57:31 EDT
1. Start your inner.
2. Switch perspectives using the perspective switcher.
3. Ctrl+3 > Java.
4. Switch back using the perspective switcher.
5. An NPE is thrown.

java.lang.NullPointerException
	at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.getTopLevelWindowFor(ModelServiceImpl.java:537)
	at org.eclipse.e4.ui.workbench.addons.perspectiveswitcher.PerspectiveSwitcher$1.handleEvent(PerspectiveSwitcher.java:105)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:41)
	at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:188)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:198)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227)
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:149)
	at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:139)
	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:73)
	at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:58)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:380)
	at org.eclipse.e4.ui.model.application.ui.advanced.impl.PerspectiveStackImpl.setSelectedElement(PerspectiveStackImpl.java:134)
	at org.eclipse.e4.ui.model.application.ui.advanced.impl.PerspectiveStackImpl.setSelectedElement(PerspectiveStackImpl.java:1)
	at org.eclipse.e4.ui.workbench.addons.perspectiveswitcher.PerspectiveSwitcher$11.widgetSelected(PerspectiveSwitcher.java:324)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
Comment 1 Remy Suen CLA 2010-06-24 18:18:33 EDT
I have delivered a workaround to PerspectiveSwitcher. The bug is caused by the new code introduced by bug 316802.
Comment 2 Paul Webster CLA 2010-07-23 16:01:45 EDT
I can't reproduce in I20100723-1415, but is there a problem still to be addressed?

PW
Comment 3 Remy Suen CLA 2010-07-23 16:03:50 EDT
(In reply to comment #2)
> I can't reproduce in I20100723-1415, but is there a problem still to be
> addressed?

Yes, the PerspectiveSwitcher should be deconstructed with the help of uninjection when a workbench window has been closed. We should switch to the new method in 4.1. There's another bug for this general problem...I think.
Comment 4 Eclipse Genie CLA 2019-04-08 19:55:23 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 5 Lars Vogel CLA 2019-06-05 07:47:32 EDT
This is a mass change to close all e4 bugs marked with "stalebug" whiteboard.

If this bug is still valid, please reopen and remove the "stalebug" keyword.