Summary: | [rename] rename type without renaming the CU | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Gordon Henriksen <malanon> |
Component: | UI | Assignee: | Markus Keller <markus.kell.r> |
Status: | ASSIGNED --- | QA Contact: | |
Severity: | enhancement | ||
Priority: | P3 | CC: | gunnar |
Version: | 3.2 | ||
Target Milestone: | --- | ||
Hardware: | Macintosh | ||
OS: | Mac OS X - Carbon (unsup.) | ||
Whiteboard: |
Description
Gordon Henriksen
2006-04-18 19:26:55 EDT
Eclipse SDK Version: 3.2.0 Build id: I20060413-1718 Darwin Gordons-MacBook-Pro.local 8.6.1 Darwin Kernel Version 8.6.1: Tue Mar 7 16:55:45 PST 2006; root:xnu-792.9.22.obj~1/RELEASE_I386 i386 i386 Have you done a refresh of your workspace before the rename refactoring? Yes. So, I guess your workspace looks as follows: Project + src + Bar.java + public class Foo { ... } If this is correct, on which java element did you try to perform the rename: compilation unit 'Bar.java' or type 'Foo' ? If this is not correct, please provide more details on your test case and how you try to perform the rename, thanks I was performing the refactor on the type. 1. Take any class file Foo.java. External to Eclipse, move it to Foo2.java. 2. Return to Eclipse. If auto-refresh is not on, refresh now. 3. Open Foo2.java, which contains class Foo, and which is in error (wrong compilation unit name…). 4. Select the type name (Foo), and perform the Rename refactor to 'Foo2'. 5. The refactor fails with the error ‘Compilation unit "Foo2.java" already exists.’ Move to JDT/UI for comments as this check is done there. We only support refactorings on compiling code. I assume that was not the case here, right? Yes, that's correct. The aggravating use case is revision history through a rename with Subversion, if it would be better to recategorize or file this as a feature. The workaround is circuitous at best: 1. Use 'svn mv Foo.java Foo2.java', since svn mv wants to operate on unmodified files. 2. mv Foo2.java Foo.java 3. Refactor with Eclipse (including a 'mv Foo.java Foo2.java')… I see. Markus, maybe you can investigate in 3.3 if this is easy doable on our side: Rename a class without renaming the CU. (In reply to comment #8) > The aggravating use case is revision history through a rename with Subversion, > if it would be better to recategorize or file this as a feature. The workaround > is circuitous at best: FYI, there are two Subversion plug-ins for Eclipse. Both integrate well with refactoring so that the revision history is preserved when you rename a compilation unit through the Eclipse refactoring actions. Changing OS from Mac OS to Mac OS X as per bug 185991 |