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

Bug 185060

Summary: [rename] Rename refactoring fails if new name is same as compilation unit
Product: [Eclipse Project] JDT Reporter: Karsten Becker <eclipse>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, markus.kell.r
Version: 3.3   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Karsten Becker CLA 2007-05-02 06:00:46 EDT
Create a class Test. Change the name of Test to something else by directly modifying it.
Start a rename Refactoring on it and change it back to Test. An error will popup that the Resource Test.java already exists..
Workaround is: Quickfix to change the compilation units name to the new name. And Start rename refactoring then.
Comment 1 Martin Aeschlimann CLA 2007-05-08 12:04:34 EDT
Don't you think the behavior is correct? The file already exists, so you can't do a rename refactoring.
Comment 2 Karsten Becker CLA 2007-05-09 05:11:54 EDT
It could just check if the name is the same as the compilation unit and change it back. There is no need to show an error if the compilation unit is not overwritten or something..
Comment 3 Dani Megert CLA 2012-01-04 04:56:06 EST
.

*** This bug has been marked as a duplicate of bug 365380 ***