Bug 178085

Summary: [push down] Push down field to class declared locally is disallowed
Product: [Eclipse Project] JDT Reporter: Brett Daniel <bdaniel3>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: ASSIGNED --- QA Contact:
Severity: normal    
Priority: P3    
Version: 3.3   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard: stalebug

Description Brett Daniel CLA 2007-03-19 12:21:48 EDT
Build ID: I20070222-0951

Steps To Reproduce:
Attempting to push down field f in the following is disallowed.

class A {
    int f;
    
    void mA(){
        class B extends A {
            public void mB(){
                super.f = 0;
            }
        }
    }
}

The error message says "Push Down is not allowed on type 'A', since it does not have subclasses to which members could be pushed down".  However, it should be able to push the field down to B which is declared locally. 

More information:
Comment 1 Markus Keller CLA 2007-07-02 13:53:28 EDT
After saving the editor, push down can be started on f. However, the refactoring reports an error because it cannot replace super.f by f:

class A {
    void mA(){
        class B extends A {
            int f;

			public void mB(){
                super.f = 0;
            }
        }
    }
}
Comment 2 Eclipse Genie CLA 2020-08-11 10:51:35 EDT
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.
Comment 3 Eclipse Genie CLA 2022-10-10 05:47:03 EDT
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.