Bug 454331

Summary: Rename fields should also rename parameters with the same name.
Product: [Eclipse Project] JDT Reporter: Andrea Del Bene <an.delbene>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P3 CC: manoj.palat, markus.kell.r, noopur_gupta
Version: 4.4.1   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Rename field dialog
none
Rename field preview none

Description Andrea Del Bene CLA 2014-12-06 15:33:34 EST
A quite nice feature I've found working with IntelliJ is the "rename" feature for class fields which can be set to rename also every method parameters with the same old name of the renamed field.
This is quite useful when you decide to rename a final field which has a getter and has one or more constructor parameters with the same name.
I haven't found this feature in Luna and, even if I'm not familiar yet with Eclipse codebase, I think it shouldn't be big deal to implement it in the Rename Dialog.

Thank you.
Comment 1 Manoj N Palat CLA 2014-12-07 22:00:42 EST
Andrea: Could you please post a code snippet showing "before rename" and "after rename" scenarios? Though your description is more or less clear, this is to make sure that we all are on the same page.

[Noopur: Moving to jdt.ui for comments]
Comment 2 Andrea Del Bene CLA 2014-12-08 07:04:18 EST
Created attachment 249233 [details]
Rename field dialog
Comment 3 Andrea Del Bene CLA 2014-12-08 07:05:29 EST
Created attachment 249234 [details]
Rename field preview
Comment 4 Andrea Del Bene CLA 2014-12-08 08:09:32 EST
Hi Manoj,

I've added two simple screenshot to show what I mean with a very basic class. As you can see I've opened the "Rename field" window to rename 'foo' field to 'foo2' (Selection_063.png), then in the preview step (Selection_064.png) everything is correctly renamed, included the getter method, BUT not method parameters with the same name (the contructor parameter 'foo' is not renamed).
Comment 5 Markus Keller CLA 2014-12-08 09:12:31 EST

*** This bug has been marked as a duplicate of bug 64698 ***