Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 324519 - SystemEditableRemoteFile throws NPE when used in headless mode
Summary: SystemEditableRemoteFile throws NPE when used in headless mode
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 3.2.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2.2   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-04 13:03 EDT by Ankit Pasricha CLA
Modified: 2010-11-09 08:17 EST (History)
3 users (show)

See Also:
mober.at+eclipse: pmc_approved+
kjdoyle: review+


Attachments
patch to check for null editor registry (11.35 KB, patch)
2010-09-07 14:40 EDT, David McKnight CLA
no flags Details | Diff
update with correct patch (1.69 KB, patch)
2010-09-07 16:44 EDT, David McKnight CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ankit Pasricha CLA 2010-09-04 13:03:10 EDT
I have some code that constructs a SystemEditableRemoteFile from an IRemoteFile and is run in headless mode. I get the following exception when this code is run;

java.lang.NullPointerException
        at org.eclipse.rse.files.ui.resources.SystemEditableRemoteFile.<init>(Sy
stemEditableRemoteFile.java:271)
        at org.eclipse.rse.internal.files.ui.view.SystemViewRemoteFileAdapter.ge
tEditableRemoteObject(SystemViewRemoteFileAdapter.java:3454)

The problem is that the editor registry is null in headless mode but the code in the SystemEditableRemoteFile does not check for this. Can you please add a check to make sure that the editor registry is not null before setting the editorDescriptor.
Comment 1 David McKnight CLA 2010-09-07 14:40:08 EDT
Created attachment 178349 [details]
patch to check for null editor registry

Ankit, does this patch help your situation or is there more to it?
Comment 2 Ankit Pasricha CLA 2010-09-07 16:27:57 EDT
Hi Dave,

I think you attached the wrong patch....this patch has way too many changes and does not seem to be in the correct area of the code :)
Comment 3 David McKnight CLA 2010-09-07 16:44:18 EDT
Created attachment 178360 [details]
update with correct patch
Comment 4 David McKnight CLA 2010-09-07 16:45:13 EDT
(In reply to comment #2)
> Hi Dave,
> 
> I think you attached the wrong patch....this patch has way too many changes and
> does not seem to be in the correct area of the code :)

Sorry, I've put in the correct patch this time.
Comment 5 Ankit Pasricha CLA 2010-09-07 20:32:57 EDT
Hi Dave, The patch looks good.
Comment 6 David McKnight CLA 2010-09-07 20:51:41 EDT
Martin and Kevin could you please review this?
Comment 7 Martin Oberhuber CLA 2010-09-08 04:14:29 EDT
+1 I can't see an issue with this, please commit.
Comment 8 David McKnight CLA 2010-09-08 07:28:41 EDT
Thanks for the review, Martin.  I've committed the change to cvs.
Comment 9 Kevin Doyle CLA 2010-09-08 17:12:38 EDT
Looks good to me as well.
Comment 10 Martin Oberhuber CLA 2010-09-09 13:35:12 EDT
Released, please test with the next M-Build (should be M20100909-1340).
Please set the bug VERIFIED when OK.
Comment 11 Martin Oberhuber CLA 2010-11-09 08:17:06 EST
Verified that this has been released to 3.3m3 as well.