Bug 391713 - [Rename method] Strong precondition: method with the same number of parameters, but different parameters type names
Summary: [Rename method] Strong precondition: method with the same number of parameter...
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3   Edit
Hardware: All All
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-11 15:30 EDT by Gustavo Soares CLA
Modified: 2014-04-16 07:42 EDT (History)
2 users (show)

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:30:11 EDT
Step 1: Create the class.

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

Step 2: apply the rename method to rename n to k. Eclipse will show a warning: Hierarchy declares a method k with the same number of parameters but different parameter type name. 

It would be nice if the tool could analyze wether the different parameter type represent a risk to behavioral preservation. In that case, for instance, we cannot have an implicit type conversion from string to long that could change a method invokation k(2) from k(long) to k(string). So the transformation is safe, we do not need a warning.
Comment 1 Karsten Wutzke CLA 2013-12-06 13:28:47 EST
I think this warning can be annoying at times and should be removed in the described cases.