Bug 434862 - [push down] Pushing down a field causes compilation error
Summary: [push down] Pushing down a field causes compilation error
Status: CLOSED DUPLICATE of bug 177636
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-14 10:47 EDT by Melina Mongiovi CLA
Modified: 2014-05-14 11:32 EDT (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 Melina Mongiovi CLA 2014-05-14 10:47:15 EDT
Pushing down a field may cause compilation error.

Reproducible: Always

Steps to Reproduce:
1. Create classes:

package p1;
public class A {
  protected int f = 11;
}

package p0;
import p1.*;
public class B extends A{
  protected int f = 10;
}

package p0;
public class C extends B {
  public long m() {
    return new B().f;
  }
}

2. Apply the push down field refactoring (push down the field f from B to C)

package p1;
public class A {
  protected int f = 11;
}

package p0;
import p1.*;
public class B extends A{
}

package p0;
public class C extends B {
  protected int f = 10;
  public long m() {
    return new B().f;
  }
}

3. After the refactoring, resulting program does not compile.
Comment 1 Melina Mongiovi CLA 2014-05-14 10:48:19 EDT
Pushing down a field may cause compilation error.

Reproducible: Always

Steps to Reproduce:
1. Create classes:

package p1;
public class A {
  protected int f = 11;
}

package p0;
import p1.*;
public class B extends A{
  protected int f = 10;
}

package p0;
public class C extends B {
  public long m() {
    return new B().f;
  }
}

2. Apply the push down field refactoring (push down the field f from B to C)

package p1;
public class A {
  protected int f = 11;
}

package p0;
import p1.*;
public class B extends A{
}

package p0;
public class C extends B {
  protected int f = 10;
  public long m() {
    return new B().f;
  }
}

3. After the refactoring, resulting program does not compile.
Comment 2 Dani Megert CLA 2014-05-14 11:32:51 EDT

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