| Summary: | [rename] The rename refactoring does not allow classes with the same names in different packages | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Mohsen Vakilian <reprogrammer> |
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | minor | ||
| Priority: | P3 | CC: | daniel_megert, nchen, raksha.vasisht, reprogrammer, snegara2 |
| Version: | 3.7 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Mohsen Vakilian
(In reply to comment #0) > Build Identifier: 20110615-0604 Rename Refactoring also updates references by default (Try to rename to some other name and see what happens) It is also behavior preserving hence gives you those errors because of an existing import/reference to the other class. > We wonder why the Rename refactoring tool of Eclipse prevents two classes with > the same names in different packages. It doesn't if you don't have references to one class in the other. (In reply to comment #1) > (In reply to comment #0) > > Build Identifier: 20110615-0604 > > Rename Refactoring also updates references by default (Try to rename to some > other name and see what happens) It is also behavior preserving hence gives you > those errors because of an existing import/reference to the other class. Raksha, this bug is about being smarter in such cases (replace import with fully qualified types). *** This bug has been marked as a duplicate of bug 33222 *** Dani is right. We are suggesting that the rename refactoring be more flexible and assist the programmer in making the change. Based on the results of our empirical study [1], programmers prefer flexible refactoring tools than restrictive ones. For example, we observed that programmers performed automated refactorings even though the tools had reported some errors. Eclipse is almost certain that the refactoring is going to break the code when it presents an error. But, such errors don't prevent programmers from using the tools. Programmers would still prefer to perform the erroneous refactoring to get some of the task done. Often, there are ways to make the tool more flexible and not report any errors. This bug report is an example of a case where the tool could have been more flexible and not report an error. [1] http://hdl.handle.net/2142/27730 |