| Summary: | [change method signature] adding parameter enables overloading and changes program behavior | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Gustavo Soares <gsoares> |
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | markus.kell.r |
| Version: | 3.8 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
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.