Bug 177636 - [push down] Push down field results in compilation error
Summary: [push down] Push down field results in compilation error
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
: 235120 319929 434862 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-03-15 15:44 EDT by Brett Daniel CLA
Modified: 2023-08-14 15:47 EDT (History)
5 users (show)

See Also:


Attachments

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