Bug 319926 - [pull up] Pulling up a method leads to compilation error: No enclosing instance of the type is accessible in scope
Summary: [pull up] Pulling up a method leads to compilation error: No enclosing instan...
Status: CLOSED DUPLICATE of bug 195005
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-14 17:37 EDT by Gustavo Soares CLA
Modified: 2010-07-28 08:31 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***