Bug 186334 - [introduce parameter object] wrong names for constructor params
Summary: [introduce parameter object] wrong names for constructor params
Status: VERIFIED 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.3 RC2   Edit
Assignee: Karsten Becker CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
: 187283 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-05-10 06:52 EDT by Martin Aeschlimann CLA
Modified: 2007-06-06 12:26 EDT (History)
1 user (show)

See Also:
benno.baumgartner: review+
martinae: review+


Attachments
Extract Parameter names from field name (8.30 KB, patch)
2007-05-24 11:15 EDT, Karsten Becker CLA
no flags Details | Diff
improved patch (5.31 KB, patch)
2007-05-24 11:56 EDT, Martin Aeschlimann CLA
no flags Details | Diff
Added test for param prefix/suffix (8.65 KB, patch)
2007-05-24 14:22 EDT, Karsten Becker CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Aeschlimann CLA 2007-05-10 06:52:45 EDT
M7
- use introduce parameter object on the folloing method and change field names to
'fX', 'fY' and 'fZ'
package p;
public class A extends TestCase {
	private void foo(int x, int y, int z) {
	}
}
- the result not only used the field names for the fields, but also for the parameters. The parameters should be unchanged from the original parameters
(or we offer to configure this)
public class FooParameter {
	public int fX;
	public int fY;
	public int fZ;

	public FooParameter(int fX, int fY, int fZ) {
		this.fX = fX;
		this.fY = fY;
		this.fZ = fZ;
	}
}
Comment 1 Martin Aeschlimann CLA 2007-05-16 11:42:55 EDT
*** Bug 187283 has been marked as a duplicate of this bug. ***
Comment 2 Karsten Becker CLA 2007-05-24 11:15:15 EDT
Created attachment 68589 [details]
Extract Parameter names from field name
Comment 3 Martin Aeschlimann CLA 2007-05-24 11:56:44 EDT
Created attachment 68602 [details]
improved patch

- only call 'getParameterName' once
- simple name has already correct plurality. No dimension needs to be added.

Karsten, can you add a test that tests the correct use of parameter prefixes?
Comment 4 Martin Aeschlimann CLA 2007-05-24 11:57:10 EDT
Benno, can you review?
Comment 5 Karsten Becker CLA 2007-05-24 14:22:15 EDT
Created attachment 68628 [details]
Added test for param prefix/suffix
Comment 6 Martin Aeschlimann CLA 2007-05-25 03:07:03 EDT
last patch is good
Comment 7 Benno Baumgartner CLA 2007-05-25 04:48:54 EDT
Patch is good

Fixed > I20070525-0010
Comment 8 Benno Baumgartner CLA 2007-05-29 06:17:46 EDT
verified in I20070527-0010