Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 356696 - [change method signature] adding parameter enables overriding and changes program behavior
Summary: [change method signature] adding parameter enables overriding and changes pro...
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:03 EDT by Gustavo Soares CLA
Modified: 2011-09-05 12:51 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:03:15 EDT
Build Identifier: 20110615-0604

The change method signature refactoring introduce a behavioral change by enabling an overriding

Reproducible: Always

Steps to Reproduce:
1. Create the classes
public class A {
  protected long k(int a) {
    return 1;
  }
}
public class B extends A { 
  protected long k() {
    return 2;
  }
  public long test() {
    return k(2);
  }
}
2. Apply the Change Method Signature to add a parameter to k()
public class A {
  protected long k(int a) {
    return 1;
  }
}
public class B extends A {
  protected long k(int a) {
    return 2;
  }
  public long test() {
    return k(2);
  }
}
3. After the refactoring, the test method returns 2 instead of 1.
Comment 1 Markus Keller CLA 2011-09-05 12:51:54 EDT

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