Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 7490 - Copying CU to same package does not rename refs within it
Summary: Copying CU to same package does not rename refs within it
Status: RESOLVED DUPLICATE of bug 5219
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Adam Kiezun CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-01-11 10:39 EST by Nick Edgar CLA
Modified: 2002-01-11 11:13 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Edgar CLA 2002-01-11 10:39:42 EST
Build 20020109

- create a CU:
public class A {
	public void run() {}
	public static void main(String[] args) {
		new A().run;
	}
}

- copy it to the same package
- it creates:
public class CopyOfA {
	public void run() {}
	public static void main(String[] args) {
		new A().run();
	}
}


Note that the constructor call has not been renamed.
I was trying to copy a CU to a different name in the same package.
I did the copy, then did the rename.
The rename did not rename the ref either since it did not correspond to the 
name of the type.
I did not notice this at first, since the new name was similar to the old name.
It ended up running the old code since the old constructor ref was unchanged.
Comment 1 Adam Kiezun CLA 2002-01-11 11:13:25 EST

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