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

Bug 537466

Summary: ResourceUtil.getFile(IEditorInput) sometimes fails to return valid adapter
Product: [Eclipse Project] Platform Reporter: Andrey Loskutov <loskutov>
Component: IDEAssignee: Andrey Loskutov <loskutov>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert
Version: 4.3   
Target Milestone: 4.9 M2   
Hardware: All   
OS: All   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=536785
https://git.eclipse.org/r/126737
https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=8a8f207b17281900ff1efc0e184d082f4146196c
Whiteboard:

Description Andrey Loskutov CLA 2018-07-29 08:32:08 EDT
Found during review of bug 536785 patches.

org.eclipse.ui.ide.ResourceUtil.getFile(IEditorInput) only checks for IFile adapters, however there are cases where clients implement IResource adapters and can deliver a file. Same for IStorageEditorInput's which can return storage probably adapting to file.

I will provide a patch in a moment.
Comment 1 Eclipse Genie CLA 2018-07-29 08:33:43 EDT
New Gerrit change created: https://git.eclipse.org/r/126737
Comment 3 Dani Megert CLA 2018-07-30 04:12:18 EDT
(In reply to Eclipse Genie from comment #2)
> Gerrit change https://git.eclipse.org/r/126737 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=8a8f207b17281900ff1efc0e184d082f4146196c
> 

Is more work planned here or can this be closed?
Comment 4 Andrey Loskutov CLA 2018-07-30 04:16:59 EDT
(In reply to Dani Megert from comment #3)
> Is more work planned here or can this be closed?

No, no work is planned. I usually wait next build results to see for regressions before closing bugs.
Comment 5 Dani Megert CLA 2018-07-30 04:42:10 EDT
(In reply to Andrey Loskutov from comment #4)
> I usually wait next build results to see for
> regressions before closing bugs.

That's fine. I asked because the bug was not assigned and did not have a target milestone.