Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 356697 - [change method signature] adding parameter enables overloading and changes program behavior
Summary: [change method signature] adding parameter enables overloading and changes pr...
Status: CLOSED DUPLICATE of bug 58616
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.8   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-04 19:07 EDT by Gustavo Soares CLA
Modified: 2011-09-05 12:52 EDT (History)
1 user (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 2011-09-04 19:07:59 EDT
Build Identifier: 20110615-0604

Adding a parameter using the change method signature refactoring may enable an overloading and changes program behavior.

Reproducible: Always

Steps to Reproduce:
1. Create the classes
public class A {
  public long k() {
    return 1;
  }
  public long k(long a) {
    return 2;
  }
  public long test() {
    return new A().k(2);
  }
}
2. Apply the Change Method Signature to add a Int parameter to k()
public class A {
  public long k(int a) {
    return 1;
  }
  public long k(long a) {
    return 2;
  }
  public long test() {
    return new A().k(2);
  }
}
3. The transformation changes behavior. After the refactoring, the test method returns 1 instead of 2.
Comment 1 Markus Keller CLA 2011-09-05 12:52:18 EDT

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