Bug 391713

Summary: [Rename method] Strong precondition: method with the same number of parameters, but different parameters type names
Product: [Eclipse Project] JDT Reporter: Gustavo Soares <gsoares>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P3 CC: daniel_megert, kwutzke
Version: 4.3   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

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.