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

Bug 16956

Summary: NPE opening java perspective.
Product: [Eclipse Project] Platform Reporter: Eduardo Pereira <eduardo_pereira>
Component: DebugAssignee: Darin Swanson <Darin_Swanson>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: jerome_lanneluc
Version: 2.0   
Target Milestone: 2.0 F2   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Eduardo Pereira CLA 2002-05-22 14:28:49 EDT
Change preferences to Open new persp. in a new window.
Close all perspectives.
Try to open the java perspective. 
Got the following NPE.

There are two problems here. 
 1) The NPE should not happen
 2) the UI should handle the exception better so the perspective should open 
without that menu option.

Copying this bug report to debug since there are two problems.

java.lang.NullPointerException
        at org.eclipse.debug.internal.ui.actions.LaunchWithConfigurationAction.g
etActivePerspectiveID(LaunchWithConfigurationAction.java:168)
        at org.eclipse.debug.internal.ui.actions.LaunchWithConfigurationAction.g
etMenu(LaunchWithConfigurationAction.java:106)
        at org.eclipse.jface.action.ActionContributionItem.fill(ActionContributi
onItem.java(Compiled Code))
        at org.eclipse.jface.action.SubContributionItem.fill(SubContributionItem
.java:45)
        at org.eclipse.jface.action.MenuManager.update(MenuManager.java(Compiled
 Code))
        at org.eclipse.jface.action.MenuManager.update(MenuManager.java:444)
        at org.eclipse.jface.action.MenuManager.fill(MenuManager.java:187)
        at org.eclipse.jface.action.SubMenuManager.fill(SubMenuManager.java:63)
        at org.eclipse.jface.action.SubContributionItem.fill(SubContributionItem
.java:45)
        at org.eclipse.jface.action.MenuManager.update(MenuManager.java(Compiled
 Code))
        at org.eclipse.jface.action.MenuManager.updateAll(MenuManager.java:575)
        at org.eclipse.ui.internal.WorkbenchWindow.updateActionBars(WorkbenchWin
dow.java:1342)
        at org.eclipse.ui.internal.WorkbenchWindow.updateActionSets(WorkbenchWin
dow.java:1360)
        at org.eclipse.ui.internal.WorkbenchWindow$7.run(WorkbenchWindow.java:11
63)
        at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:56)

        at org.eclipse.ui.internal.WorkbenchWindow.setActivePage(WorkbenchWindow
.java:1137)
        at org.eclipse.ui.internal.WorkbenchWindow.busyOpenPage(WorkbenchWindow.
java:342)
        at org.eclipse.ui.internal.Workbench.busyOpenWorkbenchWindow(Workbench.j
ava:224)
        at org.eclipse.ui.internal.Workbench.access$8(Workbench.java:217)
        at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:842)
        at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:56)

        at org.eclipse.ui.internal.Workbench.openWorkbenchWindow(Workbench.java:
839)
        at org.eclipse.ui.internal.ChangeToPerspectiveMenu.run(ChangeToPerspecti
veMenu.java:44)
        at org.eclipse.ui.actions.PerspectiveMenu.run(PerspectiveMenu.java:305)
        at org.eclipse.ui.actions.PerspectiveMenu$2.widgetSelected(PerspectiveMe
nu.java:93)
        at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java(
Compiled Code))
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java(Compiled
 Code))
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code))
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java(Compil
ed Code))
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java(Compiled
 Code))
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java(Compile
d Code))
        at org.eclipse.ui.internal.Workbench.run(Workbench.java:1068)
        at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoa
der.java:739)
        at org.eclipse.core.boot.BootLoader.run(BootLoader.java:462)
        at java.lang.reflect.Method.invoke(Native Method)
        at org.eclipse.core.launcher.Main.basicRun(Main.java:200)
        at org.eclipse.core.launcher.Main.run(Main.java:643)
        at org.eclipse.core.launcher.Main.main(Main.java:476)
java.lang.NullPointerException
Comment 1 Darin Wright CLA 2002-05-25 17:32:21 EDT
*** Bug 17857 has been marked as a duplicate of this bug. ***
Comment 2 Joe Szurszewski CLA 2002-05-28 12:17:30 EDT
Fixed in LaunchWithConfigurationAction to not always assume an active perspective.
Comment 3 Joe Szurszewski CLA 2002-05-28 12:18:21 EDT
Please verify.
Comment 4 Darin Swanson CLA 2002-05-28 21:30:54 EDT
Verified.