Project: JDT
Bug 55219 Method rename refactorying problem with overloaded methods
Reported: 2004-03-18 09:37:08 | Status: resolved fixed

Refactoring a method from an interface on a class with overloaded signatures will cause a warning that the method is part of the interface implemented by the class even though it is a completely different method. On the example below, trying to rename one of the first four method 'a' will result in a warning that the method is an implementation of method a(Long l) from the ISample interface which is clearly not the case. --- Interface --- public interface ISample { void a(Long l); } --- Class showing problem --- public class ClassA implements ISample { protected void a(Integer a) { } protected boolean a(String s) { return false; } protected void a(int[] a) { } protected void a(int a) { } protected void a(int a, int b) { } /* (non-Javadoc) * @see ISample#a(java.lang.Long) */ public void a(Long l) { // TODO Auto-generated method stub } }

Files changed in fix:
org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/Checks.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/MethodChecks.java