Bug 177636

Summary: [push down] Push down field results in compilation error
Product: [Eclipse Project] JDT Reporter: Brett Daniel <bdaniel3>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: ASSIGNED --- QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, gsoares, jjohnstn, melmongiovi, steimann
Version: 3.3   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard: stalebug

Description Brett Daniel CLA 2007-03-15 15:44:44 EDT
Build ID: I20070222-0951

Steps To Reproduce:
Push down field on the following:

	class A {
		int f;
	}
	class B extends A {
		void m() {
			new A().f = 0;
		}
	}

Yields the following refactored code:

	class A {
	}
	class B extends A {
		int f;

		void m() {
			new A().f = 0;
		}
	}

Compilation error appears due to "new A().f = 0;" since A no longer contains the field. This should have been found in refactoring preconditions.

Probably related to bug #31862.


More information:
Comment 1 Brett Daniel CLA 2007-03-15 15:46:11 EDT
(In reply to comment #0)

Bug also appears when f is referenced through "super.f".

Comment 2 Deepak Azad CLA 2010-06-15 16:21:42 EDT
*** Bug 235120 has been marked as a duplicate of this bug. ***
Comment 3 Deepak Azad CLA 2010-07-18 05:16:35 EDT
*** Bug 319929 has been marked as a duplicate of this bug. ***
Comment 4 Dani Megert CLA 2014-05-14 11:32:51 EDT
*** Bug 434862 has been marked as a duplicate of this bug. ***
Comment 5 Eclipse Genie CLA 2019-08-27 18:14:53 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.

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 6 Dani Megert CLA 2019-08-28 05:22:32 EDT
Still a problem in 4.13 M3.
Comment 7 Eclipse Genie CLA 2021-08-20 20:30:19 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.

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 8 Jeff Johnston CLA 2021-08-23 16:21:52 EDT
Still a problem in 4.21
Comment 9 Eclipse Genie CLA 2023-08-14 15:47:12 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.

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.