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

Bug 319926

Summary: [pull up] Pulling up a method leads to compilation error: No enclosing instance of the type is accessible in scope
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: daniel_megert, deepakazad
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Gustavo Soares CLA 2010-07-14 17:37:51 EDT
Build Identifier: 20100218-1602

Pulling up a method that contains a method call using qualified this may lead to compilation error: No enclosing instance of the type is accessible in scope 

Reproducible: Always

Steps to Reproduce:
1. Create the classes:
public class A {
  public long k(){
    return 3;
  }
}
public class B extends A {
  public long m(){
    return B.this.k();
  }
}

2. Apply the pull up refactoring to B.m():
public class A {
  public long k(){
    return 3;
  }
  public long m(){
    return B.this.k();
  }
}
public class B extends A {
}

3. After the refactoring, there is a compilation error: No enclosing instance of the type B is accessible in scope
Comment 1 Dani Megert CLA 2010-07-28 08:31:41 EDT

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