Bug 241035 - [pull up] refactoring causes compile an error because it replaces wrong destination type
Summary: [pull up] refactoring causes compile an error because it replaces wrong desti...
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-15 22:32 EDT by Hoon Kim CLA
Modified: 2023-05-07 14:56 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hoon Kim CLA 2008-07-15 22:32:24 EDT
Build ID: I20080617-2000

Steps To Reproduce:
1. In the following code
 A.java
package p;

class A {
	void a(A a){}
	void a(B b){}
}

B.java
package p;

class B extends A {
	void m() { 
		a(this);
	}
}

2. pull up B.m() to class A
3. the above code becomes
A.java
package p;

class A {
	void a(A a){}
	void a(A b){}
	void m() { 
		a(this);
	}
}
B.java
package p;

class B extends A {
}
4. Compile error is detected


More information:
When I pull up the B.m() method to class A, the refactoring engine process the pull up refactoring although the result code cannot be complied.

Although the refactoring engine does not need to change method signature ¡°void a(B b)¡±, the engine changes it to ¡°void a(A b)¡± in somehow. This causes this bug. The expected result is 
A.java
package p;

class A {
	void a(A a){}
	void a(B b){}
	void m() { 
		a(this);
	}
}
B.java
package p;

class B extends A {
}
Comment 1 Dani Megert CLA 2008-07-16 03:00:01 EDT
To reproduce the 'Use destination type where possible' needs to be checked.
Comment 2 Eclipse Genie CLA 2019-05-04 12:48:54 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 3 Dani Megert CLA 2019-05-05 10:39:49 EDT
Still a problem in 4.12 M1.
Comment 4 Eclipse Genie CLA 2021-04-25 08:13:46 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 5 Eclipse Genie CLA 2023-05-07 14:56:15 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.