Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 16955 - NPE opening java perspective.
Summary: NPE opening java perspective.
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P1 critical (vote)
Target Milestone: 2.0 F2   Edit
Assignee: Darin Wright CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-22 14:28 EDT by Eduardo Pereira CLA
Modified: 2002-05-29 19:57 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 Eduardo Pereira CLA 2002-05-22 14:28:33 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 Eduardo Pereira CLA 2002-05-22 14:49:32 EDT
There is another problem here. If you exit and restart the workbench you will 
get the dialog: Unable to read workbench state. Workbench UI layout will be 
reset.
Comment 2 Nick Edgar CLA 2002-05-27 16:31:27 EDT
getActiveWindow and getActivePage can return null.
Should check all senders.

Eduardo, please enter separate PRs for the serviceability issues.
Comment 3 Darin Swanson CLA 2002-05-29 18:04:44 EDT
NPE handled in bug 16956

Checked all references and added null checks where necessary.
Comment 4 Darin Swanson CLA 2002-05-29 18:05:12 EDT
Please verify (DarinW)
Comment 5 Darin Wright CLA 2002-05-29 19:57:02 EDT
Verified. Made 3 more fixes in

BreakpoingHitCountAction
EvaluateAction
JDIDebugUIPlugin