Bug 89524 - [refactoring] [5.0] Wrong change preview in introduce parameter
Summary: [refactoring] [5.0] Wrong change preview in introduce parameter
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-30 07:54 EST by Tobias Widmer CLA
Modified: 2005-04-06 11:42 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Widmer CLA 2005-03-30 07:54:12 EST
M6 test candidate

Steps to reproduce:
- Create the following method:

	/**
	 * @param string
	 */
	public void foo(String string) {
		String s= new String();
	}
- Invoke introduce parameter on constructor invocation
- Consult preview
-> Clicking on the "AboutDialog", "foo(String" and "Change signature" tree 
item shows erroneous change
Comment 1 Dirk Baeumer CLA 2005-03-30 08:36:01 EST
Markus, this might be Introduce parameter or the refactoring framework. Can you
please investigate and move to me if it is framework related.
Comment 2 Markus Keller CLA 2005-04-05 10:12:41 EDT
Dirk, the TextEdits look fine. AFAICS, the problem is in TextChange
#getPreviewContent(TextEditChangeGroup[], IRegion, boolean, int, IProgressMonitor)
, probably in the LocalTextEditProcessor that flattens edits.

PS: You can also reproduce this with ChangeMethodSignature by just adding a
parameter - that reduces the amount of generated edits.
PPS: Bug 90295 doesn't seem to have an influence on this.
Comment 3 Dirk Baeumer CLA 2005-04-06 10:59:30 EDT
Markus, as discussed moving back to you.

If easy to fix ( < 1 hour) do it. Otherwise we can ship 3.1 with the bug.
Comment 4 Markus Keller CLA 2005-04-06 11:42:21 EDT
Fixed in HEAD.

For completeness: the preview looked like this:
	/**
	 * @param string
	 * @param string2 TODO@param string
	 */
	public void foo(String string, String string2) {
		String s= string2;
	}

I opened bug 90471 to track the underlying issue in the ASTRewrite.