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

Summary: "Rename Field name" should rename constructor parameter too
Product: java Reporter: Geertjan Wielenga <geertjan>
Component: RefactoringAssignee: Jan Becicka <jbecicka>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 7.1   
Hardware: PC   
OS: Linux   
Issue Type: ENHANCEMENT Exception Reporter:

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.