This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 210801 - "Rename Field name" should rename constructor parameter too
Summary: "Rename Field name" should rename constructor parameter too
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 7.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Jan Becicka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-06 09:42 UTC by Geertjan Wielenga
Modified: 2012-04-06 14:03 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Geertjan Wielenga 2012-04-06 09:42:09 UTC
I start with this class:

public class Person {

    String name;

    public Person(String name) {
        this.name = name;
    }
    
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    
}

I now select "name" in line 3 above. I press "Ctrl-R". Now "Rename Field name" pops up. I set the new name to "type" and I select both the checkboxes "Apply Rename on Comments" and "Rename Getters and Setters". I click "Refactor" and now I see this:

public class Person {

    String type;

    public Person(String name) {
        this.type = name;
    }
    
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }
    
}

Notice that the constructor parameter still has "name", instead of "type". This is wrong and should be fixed.