Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 319929

Summary: [push down] Pushing down a field leads to compilation error: X cannot be resolved or is not a field
Product: [Eclipse Project] JDT Reporter: Gustavo Soares <gsoares>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: deepakazad
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Gustavo Soares CLA 2010-07-14 18:37:21 EDT
Build Identifier: 20100218-1602

Eclipse does not check if a field is being used before refactor it. After the refactoring there is a compilation error because the field cannot be found anymore.  

Reproducible: Always

Steps to Reproduce:
1. Create the classes:
public class A {
  protected int f;
}
public class B extends A {
  public long m(){
    return super.f;
  }
}

2. Apply the push down refactoring to A.f:
public class A {
}
public class B extends A {
  protected int f;
  public long m(){
    return super.f;
  }
}

3. The transformation leads to compilation error: f cannot be resolved or is not a field
Comment 1 Deepak Azad CLA 2010-07-18 05:16:34 EDT
See bug 177636 comment 1

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