Bug 195005 - [pull up] yields compilation error due to no enclosing instance
Summary: [pull up] yields compilation error due to no enclosing instance
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
: 319926 351383 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-06-30 02:16 EDT by kely_garcia CLA
Modified: 2023-03-09 17:11 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kely_garcia CLA 2007-06-30 02:16:48 EDT
Build ID: I20070608-1718

Steps To Reproduce:
Pull up method m on the following:

public class A {
  public Object theField;
class B extends C {
    public void m(){
      A.this.theField=null;
    }
    void mPrime(){
      m();
    }
  }
}
class C {
  public Object theField;
}

Yields the following refactored code:

public class A {
	public Object theField;

	class B extends C {
		void mPrime() {
			m();
		}
	}
}

class C {
	public Object theField;

	public void m() {
		A.this.theField = null;
	}
}

The compilation error is: "No enclosing instance of the type A is accesible in scope"


More information:
Comment 1 Olivier Thomann CLA 2007-07-01 18:17:33 EDT
Move to JDT/UI
Comment 2 Dani Megert CLA 2010-07-28 08:31:41 EDT
*** Bug 319926 has been marked as a duplicate of this bug. ***
Comment 3 Deepak Azad CLA 2011-10-18 21:46:17 EDT
*** Bug 351383 has been marked as a duplicate of this bug. ***
Comment 4 Eclipse Genie CLA 2019-02-23 13:54:06 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.

If you have further information on the current state of the bug, please add it. 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.
Comment 5 Dani Megert CLA 2019-02-24 09:02:41 EST
Still an issue in 4.11 M3.
Comment 6 Eclipse Genie CLA 2021-02-14 05:25:34 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.

If you have further information on the current state of the bug, please add it. 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.
Comment 7 Eclipse Genie CLA 2023-03-09 17:11:54 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.

If you have further information on the current state of the bug, please add it. 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.