| Summary: | [LinkedResources] linked folder / file wizards fills error log with errors | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Christian Vogt <cvogt> | ||||||||
| Component: | IDE | Assignee: | Boris Bokowski <bokowski> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||
| Severity: | normal | ||||||||||
| Priority: | P3 | CC: | eclipse, karim | ||||||||
| Version: | 3.4 | Keywords: | helpwanted | ||||||||
| Target Milestone: | 3.4 RC1 | Flags: | eclipse:
review+
|
||||||||
| Hardware: | PC | ||||||||||
| OS: | Windows XP | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Christian Vogt
I've also noticed that NPEs are thrown if any other non default file system is selected and the same procedure as above are followed. This happens if the file system returns null for their implementation of FileSystemContributor#getURI(String), which is a valid scenario according to the javadoc on that method. This is the error that gets logged: java.lang.NullPointerException at org.eclipse.core.resources.team.TeamHook.validateCreateLink(TeamHook.java:162) at org.eclipse.team.internal.core.TeamHookDispatcher.validateCreateLink(TeamHookDispatcher.java:61) at org.eclipse.core.internal.resources.LocationValidator.validateLinkLocationURI(LocationValidator.java:108) at org.eclipse.core.internal.resources.Workspace.validateLinkLocationURI(Workspace.java:2045) at org.eclipse.ui.internal.ide.dialogs.CreateLinkedResourceGroup.validateLinkLocation(CreateLinkedResourceGroup.java:608) at org.eclipse.ui.dialogs.WizardNewFileCreationPage.validateLinkedResource(WizardNewFileCreationPage.java:680) at org.eclipse.ui.dialogs.WizardNewFileCreationPage.validatePage(WizardNewFileCreationPage.java:726) at org.eclipse.ui.dialogs.WizardNewFileCreationPage.handleEvent(WizardNewFileCreationPage.java:556) at org.eclipse.ui.internal.ide.misc.ResourceAndContainerGroup.handleEvent(ResourceAndContainerGroup.java:364) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:952) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:976) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:957) at org.eclipse.swt.widgets.Text.wmCommandChild(Text.java:2423) at org.eclipse.swt.widgets.Control.WM_COMMAND(Control.java:3912) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3779) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4458) at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method) at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:2247) at org.eclipse.swt.widgets.Text.callWindowProc(Text.java:176) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3866) at org.eclipse.swt.widgets.Text.windowProc(Text.java:2067) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4458) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2333) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3367) at org.eclipse.jface.window.Window.runEventLoop(Window.java:825) at org.eclipse.jface.window.Window.open(Window.java:801) at org.eclipse.ui.internal.handlers.WizardHandler$New.executeHandler(WizardHandler.java:260) at org.eclipse.ui.internal.handlers.WizardHandler.execute(WizardHandler.java:280) at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:252) at org.eclipse.core.commands.Command.executeWithChecks(Command.java:475) at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:470) at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:165) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:470) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:821) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:879) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:568) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:510) at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:126) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1160) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:951) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:976) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:961) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:989) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:985) at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1301) at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:3883) at org.eclipse.swt.widgets.Tree.WM_CHAR(Tree.java:5608) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3776) at org.eclipse.swt.widgets.Tree.windowProc(Tree.java:5604) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4458) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2333) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3367) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2392) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2356) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2222) at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:474) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:469) 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:193) 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:362) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:175) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:615) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:564) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504) at org.eclipse.equinox.launcher.Main.run(Main.java:1251) at org.eclipse.equinox.launcher.Main.main(Main.java:1227) *** Bug 226479 has been marked as a duplicate of this bug. *** Not sure if I will have the time to fix this for 3.4, but I'll try. Mass update - removing 3.4 target. This was one of the bugs I marked for investigation (and potential fixing) in 3.4 but I ran out of time. Please ping on the bug if fixing it would be really important for 3.4, and does not require API changes or feature work. I would like to see this bug fixed. If the file system contributor returns a null location URI, then after CreateLinkedResourceGroup#validateLinkLocation(..) line 607 check if it is null and return a non-OK status instead of proceeding. Created attachment 98499 [details]
patch
Created attachment 98500 [details]
mylyn/context/zip
Christian, thanks for your help. Kim, +1? Looking at your patch in Comment #6, I do not think this will solve the NPE (I do not have the source available to test). From the stack trace I provided the trace to the NPE is at line 607: IStatus locationStatus = workspace.validateLinkLocationURI(linkHandle, locationURI); At this point the locationURI variable is null because #getLinkTargetURI() can return null if a non-local file system contributor determines the URI to be invalid (as per the javadoc). Therefore prior to validating the link location, return a warning / error status if the locationURI is null. You are right - my patch only solves the original problem described in comment 0, not the NPE from comment 1. I'll attach a new patch on Monday. Created attachment 98939 [details]
updated patch
Kim, +1?
+1 Released to HEAD. Verified that the issue from comment #0 cannot be reproduced anymore with I20080530-1730. Christian, could you please verify the problem you described in comment 1? |