| Summary: | [push down method] enables overloading + private method | ||
|---|---|---|---|
| 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: | raksha.vasisht |
| Version: | 3.6.1 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | All | ||
| Whiteboard: | |||
*** This bug has been marked as a duplicate of bug 211755 *** |
Build Identifier: 20110615-0604 Pushing down a method enables overloading of a private method changing program behavior Reproducible: Always Steps to Reproduce: 1. Create the classes: package p1; import p2.*; public class A { public long m(){ return new B().methodid_1(2); } public static void main(String[] args) { System.out.println(new B().methodid_0()); } } package p2; import p1.*; public class B extends A { private long methodid_1( int a){ return 1; } public long methodid_1( long a){ return 0; } public long methodid_0(){ return m(); } } 2. This program prints 0. Apply a push down method on m(): package p1; import p2.*; public class A { public static void main(String[] args) { System.out.println(new B().methodid_0()); } } package p2; import p1.*; public class B extends A { public long m(){ return new B().methodid_1(2); } private long methodid_1( int a){ return 1; } public long methodid_1( long a){ return 0; } public long methodid_0(){ return m(); } } 3. The behavior of the program changes. Now, the program prints 1.