Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 345607 - RenameRefactoring does not use IStorage2UriMapper
Summary: RenameRefactoring does not use IStorage2UriMapper
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: RC2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-12 10:36 EDT by Carl Wannheden CLA
Modified: 2017-09-19 18:02 EDT (History)
2 users (show)

See Also:
sebastian.zarnekow: indigo+


Attachments
proposed patch (9.09 KB, patch)
2011-05-14 04:35 EDT, Knut Wannheden CLA
no flags Details | Diff
proposed patch (take 2) (5.63 KB, patch)
2011-05-14 14:52 EDT, Knut Wannheden CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carl Wannheden CLA 2011-05-12 10:36:00 EDT
RenameRefactoring only works with platform URIs. If a custom EFS implementation is used the URIs won't be platform URIs.
As far as I can see there is no reason to not use an injectable IStorage2UriMapper to retrieve files, projects ...
Comment 1 Knut Wannheden CLA 2011-05-14 04:35:13 EDT
Created attachment 195638 [details]
proposed patch
Comment 2 Sebastian Zarnekow CLA 2011-05-14 11:37:23 EDT
Thanks for the patch. I think we should probably use IWorkspace.validateEdit(IFile[], Object) instead of #isReadonly in order to use the logic of a possible pessimistic VCS.
Comment 3 Knut Wannheden CLA 2011-05-14 14:52:12 EDT
Created attachment 195650 [details]
proposed patch (take 2)

That sounds reasonable. I've updated the patch accordingly.

I am not familiar enough with the workings of the code to determine whether there are other places where we should call IWorkspace#validateEdit() or if the LTK takes care of that. But I think the patch should at least fix the reported problem.
Comment 4 Sebastian Zarnekow CLA 2011-05-16 04:49:51 EDT
Thanks for the updated patch. Would it be possible to use the Status-Information returned by #validateEdit in the IllegalArgumentException instead of the possibly less useful generic error message? I can imagine that a pessimistic VCS implementation will provide information such as "File 'abc.extension' is already locked by user XYZ" which may be helpful if your refactoring fails.
Comment 5 Jan Koehnlein CLA 2011-05-19 02:53:30 EDT
Patch applied. Please verify refactoring works for you now.
Comment 6 Carl Wannheden CLA 2011-05-26 05:04:02 EDT
(In reply to comment #5)
> Patch applied. Please verify refactoring works for you now.

I can confirm that refactoring using non-platform URIs works. Thanks.
Comment 7 Karsten Thoms CLA 2017-09-19 17:51:38 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 8 Karsten Thoms CLA 2017-09-19 18:02:23 EDT
Closing all bugs that were set to RESOLVED before Neon.0