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 64787 - [50cat] Renaming a JavaBean properties should also rename getter and setter
Summary: [50cat] Renaming a JavaBean properties should also rename getter and setter
Status: RESOLVED DUPLICATE of bug 47625
Alias: None
Product: editor
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-21 06:29 UTC by crued
Modified: 2007-04-03 18:02 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 crued 2005-09-21 06:29:36 UTC
[ JDK VERSION : 1.5.0_01 ]

Consider the following simple class:

public class MyObject {

  private int value;

  public int getValue() {
      return value;
  }  

  public void setValue(int value) {
      this.value = value;
  }

}

If I choose "Refactor->Rename" with the caret over 
the declaration of the field "value" the 
refactoring will affect all references to the
field, but will not change the names of the getter
and setter methods associated with the property.

It would be more convenient, in the cases
where there is a pair of methods with names 
matching the names that would have been 
automatically chosen by "Refactor->Encapsulate Fields...", if the names of the accessor methods
were updated to reflect the change in the name of
the property.  Of course the user will have the 
option to choose not to perform the renaming of 
the methods if they have "preview changes" 
enabled.

So, for example, in the case above if I chose to
rename the field "value" to be "size" the result
of this refactoring would be:

public class MyObject {

  private int size;

  public int getSize() {
      return size;
  }  

  public void setSize(int size) {
      this.size = size;
  }

}
Comment 1 crued 2005-09-21 06:32:33 UTC
Note: I meant to file this as an enhancement; I neglected to change the input in 
the bug submission form.
Comment 2 mdm42 2005-11-13 08:44:06 UTC

*** This issue has been marked as a duplicate of 47625 ***