Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 279307

Summary: NPE when select a filter remove search dialog
Product: [Tools] Target Management Reporter: Samuel Wu <samuelwu>
Component: RSEAssignee: David McKnight <dmcknigh>
Status: RESOLVED FIXED QA Contact: Martin Oberhuber <mober.at+eclipse>
Severity: normal    
Priority: P3 CC: xuanchen
Version: 3.1Flags: mober.at+eclipse: pmc_approved+
xuanchen: review+
Target Milestone: 3.1 RC4   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 281401    
Attachments:
Description Flags
patch to handle case where filter is selected from search dialog none

Description Samuel Wu CLA 2009-06-05 15:51:59 EDT
Steps to reproduce:
1. Open the Remote Search dialog
2. Click the Browse button to browse for the folder
3. In the "Browse for folder" dialog, select the "My Home" filter, and click OK.
4. NPE is thrown

Trace:
eclipse.buildId=I20060223-1656
java.fullversion=J2RE 1.6.0 IBM J9 2.4 Windows XP x86-32
jvmwi3260-20080816_22093 (JIT enabled, AOT enabled)
J9VM - 20080816_022093_lHdSMr
JIT  - r9_20080721_1330ifx2
GC   - 20080724_AA
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_CA
Command-line arguments:  -os win32 -ws win32 -arch x86


Error
Fri May 22 14:47:09 EDT 2009
Unhandled event loop exception

java.lang.NullPointerException
	at
org.eclipse.rse.internal.files.ui.search.SystemSearchPage$FolderNameEditor.handleBrowseSelected(SystemSearchPage.java:447)
	at
org.eclipse.rse.internal.files.ui.search.SystemSearchPage$CommonEditor.widgetSelected(SystemSearchPage.java:255)
	at
org.eclipse.rse.internal.files.ui.search.SystemSearchPage$FolderNameEditor.widgetSelected(SystemSearchPage.java:361)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
	at org.eclipse.jface.window.Window.open(Window.java:801)
	at
org.eclipse.search.internal.ui.OpenSearchDialogAction.run(OpenSearchDialogAction.java:54)
	at
org.eclipse.search.internal.ui.OpenSearchDialogAction.run(OpenSearchDialogAction.java:45)
	at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
	at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)
	at
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:583)
	at
org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:500)
	at
org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at
org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
	at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:386)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
	at java.lang.reflect.Method.invoke(Method.java:599)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
Comment 1 David McKnight CLA 2009-06-08 10:47:20 EDT
Created attachment 138580 [details]
patch to handle case where filter is selected from search dialog

Here's a patch that uses ISubSystem.getTargetForFilter() to determine an appropriate IRemoteFile when a filter is selected.  Note that by default, only the first folder is chosen here and other folders that may be part of the filter are ignored since this search only supports one folder as it's input.
Comment 2 Martin Oberhuber CLA 2009-06-08 15:25:38 EDT
Patch is isolated to this specific problem and looks safe. The new code won't get executed unless the NPE would be hit. I'm fine with pushing this into RC4, but we'll need a 2nd committer's opinion as per our ramp-down-plan.

Dave can you get Kevin or Xuan to review this?

Comment 3 David McKnight CLA 2009-06-08 15:29:14 EDT
Xuan, could you review this?  Thanks!
Comment 4 Xuan Chen CLA 2009-06-08 16:18:45 EDT
Patch looks good to me.
Comment 5 David McKnight CLA 2009-06-08 17:01:20 EDT
I've committed the change to cvs.
Comment 6 Martin Oberhuber CLA 2009-06-10 20:14:31 EDT
Released into RC4.
Comment 7 Samuel Wu CLA 2009-06-24 15:38:42 EDT
Hi Dave,
Can you please port this fix back to 3.0.3? Thanks.
Comment 8 David McKnight CLA 2009-06-24 15:51:30 EDT
(In reply to comment #7)
> Hi Dave,
> Can you please port this fix back to 3.0.3? Thanks.
> 

I've opened bug 281401 for the backport.