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

Bug 316140

Summary: NPE when cancelling new file dialog
Product: [Tools] Linux Tools Reporter: Charley Wang <charley.wang>
Component: SystemtapAssignee: Charley Wang <charley.wang>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: anithra, pmuldoon
Version: unspecified   
Target Milestone: 0.6   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Patch for 316140 none

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/