Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 309932

Summary: [encapsulate field] Encapsulate field refactoring ignores naming conventions
Product: [Eclipse Project] JDT Reporter: Nils Kulk <n.kulk>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: markus.kell.r, n.kulk, Olivier_Thomann
Version: 3.6   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Nils Kulk CLA 2010-04-21 07:42:24 EDT
Build Identifier: 20100218-1602

When in the naming conventions "Qualify all generated field accesses with 'this.'" is switched off and a parameter prefix is configured, then encapsulate field generates a setter with 'this.' in the field reference and without prefix in the parameter.

Reproducible: Always

Steps to Reproduce:
In the naming conventions configuration, switch off "Qualify all generated field accesses with 'this.'" and set the parameter prefix list to "a".

Then, considering the following class, encapsulate the field bar:
public class Foo {
  private String bar;
}

Then the generated setter is:
public void setBar(String bar) {
  this.bar = bar;
}

Where the setter expected is:
public void setBar(String aBar) {
  bar = aBar;
}
Comment 1 Olivier Thomann CLA 2010-04-21 08:38:00 EDT
Move to JDT/UI
Comment 2 Markus Keller CLA 2010-04-21 10:48:20 EDT

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