Bug 531946 - [push down] Push Down Field yields a transformation issue.
Summary: [push down] Push Down Field yields a transformation issue.
Status: CLOSED DUPLICATE of bug 313043
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.5.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-02 13:41 EST by Jonhnanthan Oliveira CLA
Modified: 2019-01-22 05:55 EST (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 Jonhnanthan Oliveira CLA 2018-03-02 13:41:38 EST
Applying Push Down Field refactoring to move B.field to class C, the transformation yields an issue. Eclipse should update all calls to the refactored field. The method C.m() was not updated after applying the refactoring. The return statement should be "return field" and not "return super.field".

--- Before Refactoring:

public interface A {
  public int field = 11;
}

public class B implements A {
  protected int field = 10;
}

public class C extends B {
  public long m(){
    return super.field;
  }
}

--- Resulting Program:

public interface A {
  public int field = 11;
}

public class B implements A {}

public class C extends B {
  protected int field = 10;
  public long m(){
    return super.field;
  }
}
Comment 1 Dani Megert CLA 2019-01-22 05:55:13 EST

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