Bug 521761 - NPE invoking project import wizard from quick access
Summary: NPE invoking project import wizard from quick access
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: IDE (show other bugs)
Version: 4.7   Edit
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2017-09-01 11:48 EDT by Eddie Galvez CLA
Modified: 2020-05-24 16:50 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 Eddie Galvez CLA 2017-09-01 11:48:17 EDT
What steps will reproduce the problem?
1. using eclipse 4.7.0 on macosx
2. i used cmd-3 to select the import existing projects entry
3. NPE


-- Error Details --
Date: Fri Sep 01 11:43:49 EDT 2017
Message: java.lang.NullPointerException
Severity: Error
Product: Eclipse 4.7.0.20170620-1800 (org.eclipse.epp.package.rcp.product)
Plugin: org.eclipse.ui
Session Data:
eclipse.buildId=4.7.0.I20170612-0950
java.version=1.8.0_131
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.rcp.product -keyring /Users/eddie/.eclipse_keyring
Command-line arguments:  -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.rcp.product -keyring /Users/eddie/.eclipse_keyring

Exception Stack Trace:
java.lang.NullPointerException
	at org.eclipse.ui.internal.wizards.datatransfer.WizardProjectsImportPage.<init>(WizardProjectsImportPage.java:416)
	at org.eclipse.ui.wizards.datatransfer.ExternalProjectImportWizard.addPages(ExternalProjectImportWizard.java:85)
	at org.eclipse.jface.wizard.WizardDialog.createContents(WizardDialog.java:577)
	at org.eclipse.jface.window.Window.create(Window.java:426)
	at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1096)
	at org.eclipse.ui.internal.handlers.WizardHandler.execute(WizardHandler.java:311)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:291)
	at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:92)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:305)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:239)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:494)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:487)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
	at org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommand(LegacyHandlerService.java:390)
	at org.eclipse.ui.internal.quickaccess.CommandElement.execute(CommandElement.java:74)
	at org.eclipse.ui.internal.quickaccess.SearchField$2.handleElementSelected(SearchField.java:198)
	at org.eclipse.ui.internal.quickaccess.QuickAccessContents.handleSelection(QuickAccessContents.java:597)
	at org.eclipse.ui.internal.quickaccess.QuickAccessContents.access$0(QuickAccessContents.java:587)
	at org.eclipse.ui.internal.quickaccess.QuickAccessContents$4.mouseUp(QuickAccessContents.java:786)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:221)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4257)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1502)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1525)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1510)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1314)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4081)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3698)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1155)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1044)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
Comment 1 Patrik Suzzi CLA 2017-09-08 13:09:57 EDT
(In reply to Eddie Galvez from comment #0)
> What steps will reproduce the problem?
> 1. using eclipse 4.7.0 on macosx
> 2. i used cmd-3 to select the import existing projects entry
> 3. NPE
>

I tried following your steps, but I wasn't able to reproduce. 

The offending code seems to be the second line in the code below, where we get location > file > absolute path. 

if (firstElement instanceof IResource) {
  this.initialPath = ((IResource) firstElement).getLocation().toFile().getAbsolutePath();
}

My theory is that IResource#getLocation() is null because the resource is not stored in the local filesystem. 

Could you please tell me whether the project is located on your local filesystem or not?
Comment 2 Eddie Galvez CLA 2017-09-08 13:56:23 EDT
The code should be NPE resilient... and I was importing an outside set of files into the workspace, so I'm not certain why it's consider any IResource. I don't have it handy here to reproduce, but I think I'd be okay with the issue closing by guarding that NPE appropriately.
Comment 3 Patrik Suzzi CLA 2017-11-03 12:29:38 EDT
were you importing files from a network location?
Comment 4 Eddie Galvez CLA 2017-11-03 13:35:32 EDT
no, it was local
Comment 5 Eclipse Genie CLA 2020-05-24 16:50:07 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.