Bug 198792 - [Extract Class] Removes qualifier if unable to convert node
Summary: [Extract Class] Removes qualifier if unable to convert node
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M1   Edit
Assignee: Karsten Becker CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-08-03 06:07 EDT by Benno Baumgartner CLA
Modified: 2007-08-03 08:39 EDT (History)
0 users

See Also:


Attachments
Patch (5.09 KB, patch)
2007-08-03 08:18 EDT, Karsten Becker CLA
no flags Details | Diff
fix (1.80 KB, patch)
2007-08-03 08:38 EDT, Benno Baumgartner CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benno Baumgartner CLA 2007-08-03 06:07:28 EDT
I20070731-0800

Given:
package p;
public class E {
	public int field;
}

package p;
public class Test {
	public void foo() {
		E e = new E();
		if (e.field ++ > 0)
			System.out.println();
	}
}

1. Select E
2. Extract Class
3. Generate Getter/Setters
4. OK
5. Convert even node can not be converted
Is:
if (.field ++ > 0)
Should:
if (e.field ++ > 0)

Karsten can you try to fix please?
Comment 1 Karsten Becker CLA 2007-08-03 08:18:20 EDT
Created attachment 75324 [details]
Patch

The problem is caused by the fact that a moveTarget ist generated but later not used. Creation has been move further back to the point of usage. This patch also contains the visibility patch. I will recreate it once the visibility patch is in HEAD
Comment 2 Benno Baumgartner CLA 2007-08-03 08:38:36 EDT
Created attachment 75326 [details]
fix
Comment 3 Benno Baumgartner CLA 2007-08-03 08:39:31 EDT
fixed > I20070731-0800