Project: JDT
Bug 185637 [build path] NPE while trying to extend variable that points to folder
Reported: 2007-05-04 20:34:32 | Status: verified fixed

Build ID: I20070323-1616 (3.3M7) I assigned this to jdt-ui since that's where the NPE takes place, but please reassign if that is incorrect. Steps To Reproduce: 1. Right-click project -> Properties 2. Click on "Java Build Path" 3. Click on "Libraries" tab 4. Click on "Add Variable..." 5. Select a variable that points to a folder 6. Click on "Extend..." I get the following NPE: java.lang.NullPointerException at org.eclipse.jdt.internal.ui.wizards.buildpaths.JARFileSelectionDialog$FileArchiveFileFilter.select(JARFileSelectionDialog.java:135) at org.eclipse.jface.viewers.ViewerFilter.filter(ViewerFilter.java:51) at org.eclipse.ui.dialogs.ElementTreeSelectionDialog.evaluateIfTreeEmpty(ElementTreeSelectionDialog.java:362) at org.eclipse.ui.dialogs.ElementTreeSelectionDialog.open(ElementTreeSelectionDialog.java:219) at org.eclipse.jdt.internal.ui.wizards.buildpaths.NewVariableEntryDialog.chooseExtensions(NewVariableEntryDialog.java:303) at org.eclipse.jdt.internal.ui.wizards.buildpaths.NewVariableEntryDialog.extendButtonPressed(NewVariableEntryDialog.java:322) at org.eclipse.jdt.internal.ui.wizards.buildpaths.NewVariableEntryDialog$VariablesAdapter.customButtonPressed(NewVariableEntryDialog.java:71) at org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField.buttonPressed(ListDialogField.java:206) at org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField.doButtonSelected(ListDialogField.java:460) at org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField.access$0(ListDialogField.java:456) at org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField$2.widgetSelected(ListDialogField.java:422) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:227) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1101) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3320) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2972) at org.eclipse.jface.window.Window.runEventLoop(Window.java:820) at org.eclipse.jface.window.Window.open(Window.java:796) at org.eclipse.jdt.ui.wizards.BuildPathDialogAccess.chooseVariableEntries(BuildPathDialogAccess.java:213) at org.eclipse.jdt.internal.ui.wizards.buildpaths.LibrariesWorkbookPage.openVariableSelectionDialog(LibrariesWorkbookPage.java:787) at org.eclipse.jdt.internal.ui.wizards.buildpaths.LibrariesWorkbookPage.libaryPageCustomButtonPressed(LibrariesWorkbookPage.java:248) at org.eclipse.jdt.internal.ui.wizards.buildpaths.LibrariesWorkbookPage.access$0(LibrariesWorkbookPage.java:238) at org.eclipse.jdt.internal.ui.wizards.buildpaths.LibrariesWorkbookPage$LibrariesAdapter.customButtonPressed(LibrariesWorkbookPage.java:193) at org.eclipse.jdt.internal.ui.wizards.dialogfields.TreeListDialogField.buttonPressed(TreeListDialogField.java:168) at org.eclipse.jdt.internal.ui.wizards.dialogfields.TreeListDialogField.doButtonSelected(TreeListDialogField.java:386) at org.eclipse.jdt.internal.ui.wizards.dialogfields.TreeListDialogField.access$2(TreeListDialogField.java:382) at org.eclipse.jdt.internal.ui.wizards.dialogfields.TreeListDialogField$2.widgetSelected(TreeListDialogField.java:347) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:227) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1101) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3320) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2972) at org.eclipse.jface.window.Window.runEventLoop(Window.java:820) at org.eclipse.jface.window.Window.open(Window.java:796) at org.eclipse.ui.dialogs.PropertyDialogAction.run(PropertyDialogAction.java:156) at org.eclipse.jface.action.Action.runWithEvent(Action.java:498) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:545) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:490) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:402) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1101) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3320) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2972) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2365) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2329) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2204) at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176) 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:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:497) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:436) at org.eclipse.equinox.launcher.Main.run(Main.java:1162)

Files changed in fix:
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/JARFileSelectionDialog.java