Bug 39281 - Unable Refacter (renaming) an inner class
Summary: Unable Refacter (renaming) an inner class
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M2   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-24 13:54 EDT by Danny Molloy CLA
Modified: 2003-09-03 09:51 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Danny Molloy CLA 2003-06-24 13:54:21 EDT
Eclipse version 2.1 (build id: 200302061700), jsdk 1.4.1_01

The problem I encountered was when I created an inner class and then attempted 
to use the refactering tool to rename the inner class by capitalizing the first 
letter. Once the refactering was completed the following error was received in 
the tasks window: 

"A class file was not written. The project may be inconsistent, if so try 
refreshing this project and rebuilding it."

By refactering the inner class helloWorld to HelloWorld, the error is 
generated. However, if I refacter the helloWorld to ThisIsATest then no 
problems are encountered. It appears to be a case sensitivity issue. This same 
error occurs even if the refactering is done manually.

Doing a rebuild of the project does correct the problem. 

The following is a sample test class that I used to confirm the defect with. 

********************************************************************

public class MyTest {
	public static void main(String[] args) {
		MyTest mt = new MyTest();
		mt.someMethod();
	}
	public void someMethod() {
		helloWorld world = new helloWorld(new String("Hello")); 
		
	}
	public class helloWorld {
		public helloWorld(String param) {
			myHello(param);
		}
		public void myHello(String param) {
			System.out.println(param);
		}
	}
}

********************************************************************
Comment 1 Philipe Mulet CLA 2003-06-30 05:51:52 EDT
Incremental builder should be resilient with case changes.
Comment 2 Kent Johnson CLA 2003-07-07 15:49:40 EDT
The class files are colliding on disk. We do not detect & delete the 'obsolete' 
class files (defined by the source file) until after the new class files are 
written.

I've add support to catch this case & perform a rebuild.
Comment 3 Philipe Mulet CLA 2003-07-09 07:00:45 EDT
Hope this isn't too deadly for end users... can't it be scoped to the actual 
file being compile ? 
Comment 4 David Audel CLA 2003-07-18 07:02:03 EDT
Verified.
Comment 5 Philipe Mulet CLA 2003-09-03 09:51:34 EDT
*** Bug 42443 has been marked as a duplicate of this bug. ***