Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 185772

Summary: [introduce parameter object] new method conflicts with existing
Product: [Eclipse Project] JDT Reporter: Martin Aeschlimann <martinae>
Component: UIAssignee: Karsten Becker <eclipse>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: markus.kell.r
Version: 3.3   
Target Milestone: 3.3 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Martin Aeschlimann CLA 2007-05-07 10:24:44 EDT
M7

- in the following example use 'Introduce Parameter Object' on 'add(int, int)'
  - add both parameters to the new class

package e;

public class A {

	public int add(int x, int y) {
		return x + y;
	}
	
	public int add(Object o) {
		return 0;
	}
		
	public void foo() {
		add(1, 2);
		add(null);
	}
}

the result is:
package e;

public class A {

	public int add(AddParameter parameterObject) {
		return parameterObject.x + parameterObject.y;
	}
	
	public int add(Object o) {
		return 0;
	}
		
	public void foo() {
		add(new AddParameter(1, 2));
		add(null);
	}
}

- add(null) does not resolve to add(Object) anymore
Comment 1 Karsten Becker CLA 2007-05-07 11:37:21 EDT
Problem also exists in CMS
Comment 2 Markus Keller CLA 2007-05-07 12:07:36 EDT
Corner case, suggest to do defer.

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