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

Bug 329270

Summary: [encapsulate field] "Conventions for variable names" not respected when creating getter/setter
Product: [Eclipse Project] JDT Reporter: arne anka <eclipse-bugs>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, Olivier_Thomann
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description arne anka CLA 2010-11-02 12:09:48 EDT
Build Identifier: 20100917-0705

in 
Preferences->Java->Code Style->Conventions for variable names
i defined Parameters to start with "a".
in my class i got a field 
int myFoo 
and let eclipse create getter and setter (via Quick Fix).

the generated setter looks like

public void setFoo(int foo){ myFoo = foo; }

but, from the configuration in 
Preferences->Java->Code Style->Conventions for variable names
i expect it to look like

public void setFoo(int aFoo){ myFoo = aFoo; }

Reproducible: Always

Steps to Reproduce:
1. configure a Parameter-prefix in Preferences->Java->Code Style->Conventions for variable names
2. let eclipse create a setter
3. watch the configured prefix being ignored
Comment 1 Olivier Thomann CLA 2010-11-02 12:36:02 EDT
Using HEAD, I get:
	public void setMyFoo(int aMyFoo) {
		myFoo = aMyFoo;
	}
Comment 2 arne anka CLA 2010-11-03 04:25:02 EDT
via Quick Fix or context menu -> Source -> Generate Setters and Getters?
the latter apparently respects the settings, Quick Fix does not.
Comment 3 Olivier Thomann CLA 2010-11-05 21:27:00 EDT
Move to JDT/UI
Comment 4 Dani Megert CLA 2010-11-08 07:54:49 EST

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