Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 348278 - [push down] Pushing down method leads to compilation error: No enclosing instance of the type T is accessible in scope
Summary: [push down] Pushing down method leads to compilation error: No enclosing inst...
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6.1   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-03 16:38 EDT by Gustavo Soares CLA
Modified: 2020-02-14 20:31 EST (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 2011-06-03 16:38:29 EDT
Pushing down 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 

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

2. Apply the push down refactoring to A.m():
public class A {
  public long k( ){
    return 1;
  }
}
public class B extends A{
  public long m(){
	  return A.this.k();
  }
}

3. After the refactoring, there is a compilation error: No enclosing instance
of the type A is accessible in scope

There is a bug in the pull up method as well: bug 195005
Comment 1 Srikanth Sankaran CLA 2011-06-03 22:49:22 EDT
Move to JDT/UI for comment.
Comment 2 Eclipse Genie CLA 2020-02-14 20:31:20 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.