Bug 391715 - [Rename method] Strong precondition: the reference 'k' will be shadowed by a rename declaration
Summary: [Rename method] Strong precondition: the reference 'k' will be shadowed by a ...
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3   Edit
Hardware: PC Mac OS X
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-11 15:40 EDT by Gustavo Soares CLA
Modified: 2012-10-11 15:40 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gustavo Soares CLA 2012-10-11 15:40:09 EDT
1o. step: Create the classes:

public class A {
	
	public long k(long a) {
		return 10;
	}
	
	
}

public class B extends A {

	public long n(int a) {
		return 20;
	}
	
	public long test() {
		return k(2);
	}
	
}

Apply the rename method to rename n to k. Eclipse will show the warning: the reference k will be shadowed by a renamed declaration. It would be nice if Eclipse  suggests an additional change to perform the transformation: 

public class A {
	
	public long k(long a) {
		return 10;
	}
	
	
}

public class B extends A {

	public long k(int a) {
		return 20;
	}
	
	public long test() {
		return super.k(2);
	}
	
}