| Summary: | NPE when adding a new JRE | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Olivier Thomann <Olivier_Thomann> | ||||
| Component: | Debug | Assignee: | Darin Wright <darin.eclipse> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | blocker | ||||||
| Priority: | P3 | CC: | cocoakevin | ||||
| Version: | 3.2 | ||||||
| Target Milestone: | 3.2 M1 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Olivier Thomann
This happens when starting with -vm on the command line. It is then impossible to add a new installed JRE. Should be fixed for 3.2M1. Fixed in VMLibraryBlock. Now I get: java.lang.NullPointerException at org.eclipse.jdt.internal.debug.ui.jres.VMLibraryBlock.isDefaultLocations(VMLibraryBlock.java:573) at org.eclipse.jdt.internal.debug.ui.jres.VMLibraryBlock.performApply(VMLibraryBlock.java:560) at org.eclipse.jdt.internal.debug.ui.jres.AddVMDialog.setFieldValuesToVM(AddVMDialog.java:409) at org.eclipse.jdt.internal.debug.ui.jres.AddVMDialog.doOkPressed(AddVMDialog.java:372) at org.eclipse.jdt.internal.debug.ui.jres.AddVMDialog.okPressed(AddVMDialog.java:365) at org.eclipse.jface.dialogs.Dialog.buttonPressed(Dialog.java:409) at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:556) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:868) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3137) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2765) at org.eclipse.jface.window.Window.runEventLoop(Window.java:809) at org.eclipse.jface.window.Window.open(Window.java:787) at org.eclipse.jdt.internal.debug.ui.jres.InstalledJREsBlock.addVM(InstalledJREsBlock.java:586) at org.eclipse.jdt.internal.debug.ui.jres.InstalledJREsBlock.access$8(InstalledJREsBlock.java:583) at org.eclipse.jdt.internal.debug.ui.jres.InstalledJREsBlock$8.handleEvent(InstalledJREsBlock.java:342) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:868) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3137) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2765) at org.eclipse.jface.window.Window.runEventLoop(Window.java:809) at org.eclipse.jface.window.Window.open(Window.java:787) at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.open(FilteredPreferenceDialog.java:363) at org.eclipse.ui.internal.OpenPreferencesAction.run(OpenPreferencesAction.java:66) at org.eclipse.jface.action.Action.runWithEvent(Action.java:996) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:868) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3137) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2765) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1734) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1698) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163) 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:585) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:338) at org.eclipse.core.launcher.Main.basicRun(Main.java:282) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952) I patched my eclipse install and restarted with -clean option. Do I need to create a new workspace? fixed in VMLibraryBlock Darin, please verify Should not the access to getVMInstall() be protected for a null check in this code?
protected void handleRestoreDefault() {
File installLocation = getVMInstall().getInstallLocation();
LibraryLocation[] libs = null;
if (installLocation == null) {
libs = new LibraryLocation[0];
} else {
libs = getVMInstallType().getDefaultLibraryLocations(installLocation);
}
fLibraryContentProvider.setLibraries(libs);
update();
}
Indeed, this should also be protected with a null check. Clicking on restore default leads to: java.lang.NullPointerException at org.eclipse.jdt.internal.debug.ui.jres.VMLibraryBlock.handleRestoreDefault(VMLibraryBlock.java:463) at org.eclipse.jdt.internal.debug.ui.jres.VMLibraryBlock.widgetSelected(VMLibraryBlock.java:642) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:868) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3137) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2765) at org.eclipse.jface.window.Window.runEventLoop(Window.java:809) at org.eclipse.jface.window.Window.open(Window.java:787) at org.eclipse.jdt.internal.debug.ui.jres.InstalledJREsBlock.addVM(InstalledJREsBlock.java:586) at org.eclipse.jdt.internal.debug.ui.jres.InstalledJREsBlock.access$8(InstalledJREsBlock.java:583) at org.eclipse.jdt.internal.debug.ui.jres.InstalledJREsBlock$8.handleEvent(InstalledJREsBlock.java:342) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:868) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3137) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2765) at org.eclipse.jface.window.Window.runEventLoop(Window.java:809) at org.eclipse.jface.window.Window.open(Window.java:787) at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.open(FilteredPreferenceDialog.java:363) at org.eclipse.ui.internal.OpenPreferencesAction.run(OpenPreferencesAction.java:66) at org.eclipse.jface.action.Action.runWithEvent(Action.java:996) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:868) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3137) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2765) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1734) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1698) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163) 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.invokeFramework(Main.java:338) at org.eclipse.core.launcher.Main.basicRun(Main.java:282) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952) Created attachment 25855 [details]
Proposed fix
Applied patch. verified |