Project: Eclipse_Platform_UI
Bug 117949 NPE in export wizard
Reported: 2005-11-24 14:43:01 | Status: resolved fixed

Build id: I20051122-0800 If I try to open the archive file export wizard while I have projects with non-local locations, I get a NullPointerException. WizardFileSystemResourceExportPage1.getConflictingContainerNameFor has this line of problematic code: if (projects[i].getLocation().isPrefixOf(testPath)) If the project location is null, this causes the NPE. I suggest deleting this method and using IWorkspaceRoot.findContainersForLocation, which does all the same checks and more (such as overlapping with linked resources). java.lang.NullPointerException at org.eclipse.ui.internal.wizards.datatransfer.WizardFileSystemResourceExportPage1.getConflictingContainerNameFor(WizardFileSystemResourceExportPage1.java:478) at org.eclipse.ui.internal.wizards.datatransfer.WizardFileSystemResourceExportPage1.validateDestinationGroup(WizardFileSystemResourceExportPage1.java:424) at org.eclipse.ui.internal.wizards.datatransfer.WizardArchiveFileResourceExportPage1.validateDestinationGroup(WizardArchiveFileResourceExportPage1.java:393) at org.eclipse.ui.dialogs.WizardDataTransferPage.determinePageCompletion(WizardDataTransferPage.java:178) at org.eclipse.ui.dialogs.WizardExportResourcesPage.updateWidgetEnablements(WizardExportResourcesPage.java:617) at org.eclipse.ui.dialogs.WizardExportResourcesPage.createControl(WizardExportResourcesPage.java:244) at org.eclipse.ui.internal.wizards.datatransfer.WizardFileSystemResourceExportPage1.createControl(WizardFileSystemResourceExportPage1.java:105) at org.eclipse.ui.internal.wizards.datatransfer.WizardArchiveFileResourceExportPage1.createControl(WizardArchiveFileResourceExportPage1.java:76) at org.eclipse.jface.wizard.Wizard.createPageControls(Wizard.java:179) at org.eclipse.jface.wizard.WizardDialog.createPageControls(WizardDialog.java:611) at org.eclipse.jface.wizard.WizardDialog.setWizard(WizardDialog.java:978) at org.eclipse.jface.wizard.WizardDialog.updateForPage(WizardDialog.java:1029) at org.eclipse.jface.wizard.WizardDialog.access$2(WizardDialog.java:1026) at org.eclipse.jface.wizard.WizardDialog$4.run(WizardDialog.java:1016) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69) at org.eclipse.jface.wizard.WizardDialog.showPage(WizardDialog.java:1014) at org.eclipse.ui.internal.dialogs.ImportExportPage.treeDoubleClicked(ImportExportPage.java:235) at org.eclipse.ui.internal.dialogs.ExportPage$2.doubleClick(ExportPage.java:65) at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:720) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.runtime.Platform.run(Platform.java:785) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:148) at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:718) at org.eclipse.jface.viewers.StructuredViewer.handleDoubleSelect(StructuredViewer.java:950) at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1057) at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:220) at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:217) at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:276) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:905) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3241) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2861)

Files changed in fix:
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/WizardFileSystemResourceExportPage1.java