Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 53303 - [ContextMgmt] NPE switching to Debug perspective
Summary: [ContextMgmt] NPE switching to Debug perspective
Status: RESOLVED DUPLICATE of bug 54928
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P2 major (vote)
Target Milestone: ---   Edit
Assignee: Chris McLaren CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-27 13:53 EST by Jean-Michel Lemieux CLA
Modified: 2004-04-12 22:02 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Michel Lemieux CLA 2004-02-27 13:53:39 EST
I20040225
My workbench had been running for a while and I had previously switched between
Java and Debug perspectives. The NPE happened after a breakpoint was hit, but
the perspective was still the Java. I then switched manually pressing the pers.
icon, and the following was in my log. After this, my workbench was in a bad
state, debugging didn't really work, editors couldn't be opened.

java.lang.NullPointerException
at
org.eclipse.ui.internal.PerspectivePresentation.addPart(PerspectivePresentation.java:203)
at org.eclipse.ui.internal.Perspective.showView(Perspective.java:1400)
at org.eclipse.ui.internal.WorkbenchPage.busyShowView(WorkbenchPage.java:720)
at org.eclipse.ui.internal.WorkbenchPage.access$9(WorkbenchPage.java:697)
at org.eclipse.ui.internal.WorkbenchPage$13.run(WorkbenchPage.java:2882)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:84)
at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:2879)
at
org.eclipse.debug.internal.ui.views.launch.LaunchViewContextListener.contextActivated(LaunchViewContextListener.java:235)
at
org.eclipse.debug.internal.ui.views.launch.LaunchViewContextListener.contextChanged(LaunchViewContextListener.java:173)
at org.eclipse.ui.internal.contexts.Context.fireContextChanged(Context.java:117)
at
org.eclipse.ui.internal.contexts.MutableContextManager.notifyContexts(MutableContextManager.java:140)
at
org.eclipse.ui.internal.contexts.MutableContextManager.setEnabledContextIds(MutableContextManager.java:274)
at
org.eclipse.debug.internal.ui.views.launch.LaunchView.showViewsForCurrentSelection(LaunchView.java:554)
at
org.eclipse.debug.internal.ui.views.launch.LaunchView.selectionChanged(LaunchView.java:500)
at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:159)
at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:788)
at org.eclipse.core.runtime.Platform.run(Platform.java:497)
at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:157)
at
org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:1310)
at
org.eclipse.jface.viewers.StructuredViewer.setSelection(StructuredViewer.java:1033)
at
org.eclipse.debug.internal.ui.views.launch.LaunchView.autoExpand(LaunchView.java:1098)
at
org.eclipse.debug.internal.ui.views.launch.LaunchView.initializeSelection(LaunchView.java:372)
at
org.eclipse.debug.internal.ui.views.launch.LaunchView.becomesVisible(LaunchView.java:1363)
at
org.eclipse.debug.ui.AbstractDebugView$DebugViewPartListener.partVisible(AbstractDebugView.java:161)
at org.eclipse.ui.internal.PartListenerList2$7.run(PartListenerList2.java:175)
at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:788)
at org.eclipse.core.runtime.Platform.run(Platform.java:497)
at
org.eclipse.ui.internal.PartListenerList2.firePartVisible(PartListenerList2.java:173)
at org.eclipse.ui.internal.WorkbenchPage$1.propertyChange(WorkbenchPage.java:136)
at org.eclipse.ui.internal.LayoutPart.setVisible(LayoutPart.java:234)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:376)
at org.eclipse.ui.internal.PartTabFolder.setSelection(PartTabFolder.java:1221)
at org.eclipse.ui.internal.PartTabFolder.setSelection(PartTabFolder.java:1205)
at org.eclipse.ui.internal.PartTabFolder.createControl(PartTabFolder.java:546)
at
org.eclipse.ui.internal.PartSashContainer.createControl(PartSashContainer.java:240)
at
org.eclipse.ui.internal.PerspectivePresentation.activate(PerspectivePresentation.java:117)
at org.eclipse.ui.internal.Perspective.onActivate(Perspective.java:629)
at org.eclipse.ui.internal.WorkbenchPage.setPerspective(WorkbenchPage.java:2666)
at org.eclipse.ui.internal.WorkbenchPage.busySetPerspective(WorkbenchPage.java:687)
at org.eclipse.ui.internal.WorkbenchPage.access$8(WorkbenchPage.java:672)
at org.eclipse.ui.internal.WorkbenchPage$12.run(WorkbenchPage.java:2796)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:84)
at org.eclipse.ui.internal.WorkbenchPage.setPerspective(WorkbenchPage.java:2794)
at
org.eclipse.ui.internal.PerspectiveBarContributionItem$2.widgetSelected(PerspectiveBarContributionItem.java:92)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:89)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:833)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2352)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2033)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1566)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1542)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:263)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:139)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:47)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:256)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:100)
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:324)
at org.eclipse.core.launcher.Main.basicRun(Main.java:279)
at org.eclipse.core.launcher.Main.run(Main.java:742)
at org.eclipse.core.launcher.Main.main(Main.java:581)
Comment 1 Nick Edgar CLA 2004-03-01 10:11:17 EST
Had you switched to the Debug perspective previously in the same session?
It looks like it's lazily recreating the Debug perspective.  While it's doing 
this, the configured contexts are changed resulting in new views being shown.
But the PerspectivePresentation does not seem to be fully initialized at this 
time.  At line 203 of PerspectivePresentation, it must be folder.getControl() 
that is returning null.

Kim, can you investigate?
Comment 2 Kim Horne CLA 2004-03-25 16:31:52 EST
Psst.  You need to add me to the CC list.  :)

This seems to be a dupe of 56176.  I tried tracking this down earlier but I was
unable to reproduce it.  There are several other debug problems that are similar
to this.  I figure your guess is right, however...
Comment 3 Stefan Xenos CLA 2004-04-12 22:02:40 EDT

*** This bug has been marked as a duplicate of 54928 ***