Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 316140 - NPE when cancelling new file dialog
Summary: NPE when cancelling new file dialog
Status: VERIFIED FIXED
Alias: None
Product: Linux Tools
Classification: Tools
Component: Systemtap (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 0.6   Edit
Assignee: Charley Wang CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-08 10:20 EDT by Charley Wang CLA
Modified: 2010-06-09 11:56 EDT (History)
2 users (show)

See Also:


Attachments
Patch for 316140 (2.21 KB, patch)
2010-06-08 10:39 EDT, Charley Wang CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Charley Wang CLA 2010-06-08 10:20:29 EDT
Reproducibility:

1. Open SystemTap IDE perspective
2. Open Function view
3. With no editors open, double click an element to open the New File dialog
4. Click cancel on the New File dialog

Result:
NPE

Expected:
Cancel dialog.
Comment 1 Charley Wang CLA 2010-06-08 10:39:29 EDT
Created attachment 171407 [details]
Patch for 316140

Adds field to OpenFileAction so callers can tell if the action succeeded or failed/was cancelled. This can be used by other actions that call OpenFileAction as well.

I don't know if this patch can be applied for the immediate release, may have to wait for the next release?
Comment 2 Andrew Overholt CLA 2010-06-08 10:59:47 EDT
Is there a way we can write a unit test for this to ensure we're fixing the problem?  I'd feel more comfortable with putting it into 0.6 if we could do that.
Comment 3 Andrew Overholt CLA 2010-06-08 13:42:20 EDT
I can reproduce this behaviour.  If Anithra is good with the patch, I'm in favour of including it in 0.6.  I'll adjust the target milestone so we can track this.
Comment 4 Andrew Overholt CLA 2010-06-09 10:17:58 EDT
Assuming we take care of errors from returning early from FunctionBrowserAction#run (if we're not handling them now, I can't see how this would get much worse but please verify/comment to that effect), this patch is fine by me.
Comment 5 Charley Wang CLA 2010-06-09 10:31:20 EDT
(In reply to comment #4)
> Assuming we take care of errors from returning early from
> FunctionBrowserAction#run (if we're not handling them now, I can't see how this
> would get much worse but please verify/comment to that effect), this patch is
> fine by me.

It doesn't look like errors from FunctionBrowserAction are handled, but AFAICT nothing follows a call to FunctionBrowserAction#run so if it fails to run the view just fails to open, which is expected behaviour if a user clicks 'Cancel' on the dialog. 

Patch applied in SVN Commit 24988, setting as Resolved if there are no objections :)
Comment 6 Andrew Overholt CLA 2010-06-09 10:43:24 EDT
Please comment here when you've verified with the not-yet-finished build 237:

https://build.eclipse.org/hudson/job/cbi-linuxtools-Helios/237/

You can move it to VERIFIED or CLOSED then.
Comment 7 Charley Wang CLA 2010-06-09 11:56:24 EDT
Verified as fixed using a fresh Helios SDK RC4 and the June 9 build artifact:
https://build.eclipse.org/hudson/job/cbi-linuxtools-Helios/237/artifact/build/I201006091041/