Community
Participate
Working Groups
Build ID: M20071023-1652 Steps To Reproduce: Pushing down the method y() from X to SubX succeeds but does not preserve the behaviour. class SuperX { void x() { System.out.println("SuperX: x()"); } } class X extends SuperX { void x() { System.out.println("X: x()"); } void y() { super.x(); } } class SubX extends X { public static void main(String[] args) { new SubX().y(); } } More information:
Here is another example that does not preserve behaviour. Pushing down x() from X to SubX changes the printed message from 1 to 2. class X { void x() { System.out.println(y); } public int y = 1; } class SubX extends X { public int y = 2; public static void main(String[] args) { new SubX().x(); } }
*** Bug 211860 has been marked as a duplicate of this bug. ***
*** Bug 316828 has been marked as a duplicate of this bug. ***
Though you can argue that user wants to change the program behavior, a warning on the preview page would be nice.
>Though you can argue that user wants to change the program behavior, a warning >on the preview page would be nice. The point (and main difference to a quick assist) is that it must be preserving. In the past we started to lift that a little bit but in all those cases we switch to the preview page and show a warning.
*** Bug 356684 has been marked as a duplicate of this bug. ***
*** Bug 356698 has been marked as a duplicate of this bug. ***
*** Bug 355324 has been marked as a duplicate of this bug. ***
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.
Statements that could cause changes in behaviour: - super calls (comment 0) - access to a field that is hidden in the subclass (comment 1) See also the duplicates for additional relevant situations. Anyone up to the task to implement corresponding warnings?