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

Bug 345607

Summary: RenameRefactoring does not use IStorage2UriMapper
Product: [Modeling] TMF Reporter: Carl Wannheden <carl.wannheden>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jan, sebastian.zarnekow
Version: 2.0.0Flags: sebastian.zarnekow: indigo+
Target Milestone: RC2   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
proposed patch
none
proposed patch (take 2) none

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