Project: Eclipse_Platform_UI
Bug 54928 NPE on switching perspective for debugging
Reported: 2004-03-15 20:25:01 | Status: resolved fixed

I received this NPE when switching from the Java perspective to the debug perspective after launching a program and hitting a breakpoint. I have set to switch always. In my target on the HEAD code. java.lang.NullPointerException at org.eclipse.ui.internal.PerspectivePresentation.addPart (PerspectivePresentation.java:203) at org.eclipse.ui.internal.Perspective.showView(Perspective.java:1401) at org.eclipse.ui.internal.WorkbenchPage.busyShowView(WorkbenchPage.java:721) at org.eclipse.ui.internal.WorkbenchPage.access$9(WorkbenchPage.java:698) at org.eclipse.ui.internal.WorkbenchPage$13.run(WorkbenchPage.java:2883) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:84) at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:2880) at org.eclipse.debug.internal.ui.views.launch.LaunchViewContextListener.contextActi vated(LaunchViewContextListener.java:235) at org.eclipse.debug.internal.ui.views.launch.LaunchViewContextListener.contextChan ged(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.showViewsForCurrentSelecti on(LaunchView.java:560) 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:646) 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:1107) 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:1372) 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:646) 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:137) at org.eclipse.ui.internal.LayoutPart.setVisible(LayoutPart.java:233) at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:381) at org.eclipse.ui.internal.PartTabFolder.setSelection(PartTabFolder.java:1208) at org.eclipse.ui.internal.PartTabFolder.setSelection(PartTabFolder.java:1192) at org.eclipse.ui.internal.PartTabFolder.createControl(PartTabFolder.java:534) 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:630) at org.eclipse.ui.internal.WorkbenchPage.setPerspective(WorkbenchPage.java:2667) at org.eclipse.ui.internal.WorkbenchPage.busySetPerspective (WorkbenchPage.java:688) at org.eclipse.ui.internal.WorkbenchPage.access$8(WorkbenchPage.java:673) at org.eclipse.ui.internal.WorkbenchPage$12.run(WorkbenchPage.java:2797) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:84) at org.eclipse.ui.internal.WorkbenchPage.setPerspective(WorkbenchPage.java:2795) at org.eclipse.ui.internal.Workbench.showPerspective(Workbench.java:1522) at org.eclipse.debug.internal.ui.launchConfigurations.PerspectiveManager.switchToPe rspective(PerspectiveManager.java:173) at org.eclipse.debug.internal.ui.launchConfigurations.PerspectiveManager$5.run (PerspectiveManager.java:317) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:106) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:2344) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2051) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1451) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1422) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:258) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:139) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:48) at org.eclipse.core.internal.runtime.PlatformActivator$1.run (PlatformActivator.java:260) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:173) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:106) 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:305) at org.eclipse.core.launcher.Main.run(Main.java:745) at org.eclipse.core.launcher.Main.main(Main.java:713)

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PerspectivePresentation.java