Bug 290618 - [push down] program behavior changes: calls overloaded method
Summary: [push down] program behavior changes: calls overloaded method
Status: CLOSED DUPLICATE of bug 211860
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-25 21:02 EDT by Gustavo Soares CLA
Modified: 2010-06-15 15:49 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 2009-09-25 21:02:09 EDT
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; pt-BR; rv:1.9.0.14) Gecko/2009090216 Ubuntu/9.04 (jaunty) Firefox/3.0.14 GTB5
Build Identifier: 20090619-0625

When a push down method refactoring is applied on a method "m", and there is a method invocation to a method of the superclass inside "m". The method invocation changes to a method of the subclass. 

Reproducible: Always

Steps to Reproduce:
1. Create the classes:
public class A {
 public int k(long i) { return 79;}
 public int m() { return k(2);}
}

public class B extends A{

	public int k(int i) { return 83;}	

	public static void main(String[] args) {
		B b = new B();
		System.out.println(b.m());
	}
}
2. This program prints 79. Apply a push down method on m():

public class A {
 public int k(long i) { return 79;}
}

public class B extends A{
	public int k(int i) { return 83;}	

	public int m() { return k(2);}

	public static void main(String[] args) {
		B b = new B();
		System.out.println(b.m());
	}
}
3. The behavior of the program changes. Now, the program prints 83.
Comment 1 Markus Keller CLA 2009-10-05 14:19:22 EDT
See also bug 234981.
Comment 2 Deepak Azad CLA 2010-06-15 15:49:33 EDT

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