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

Bug 458464

Summary: [pull up] incorrect replacement of 'super' keyword with 'this' when it references grandparents' member
Product: [Eclipse Project] JDT Reporter: Jongwook Kim <jongwook.kim>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: gautier.desaintmartinlacaze, jongwook.kim, noopur_gupta
Version: 3.8.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug

Description Jongwook Kim CLA 2015-01-26 15:14:12 EST
When method m and field f are pulled up, replacement of 'super' keyword with 'this' changes the binding of field f.

--------------------
BEFORE
--------------------
class A extends B {	
	int f = 0;
	
	void m() {
		System.out.println(super.f);  // referencing inherited f
	}
}

class B extends C {

}

class C {
	int f = 1;
}

--------------------
AFTER
--------------------
class A extends B {	

}

class B extends C {
	int f = 0;
	
	protected void m() {
		System.out.println(this.f);  // Change of binding
	}
}

class C {
	protected int f = 1;
}
Comment 1 Eclipse Genie CLA 2020-05-13 07:11:06 EDT
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.