Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 329270 - [encapsulate field] "Conventions for variable names" not respected when creating getter/setter
Summary: [encapsulate field] "Conventions for variable names" not respected when creat...
Status: CLOSED DUPLICATE of bug 252779
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-02 12:09 EDT by arne anka CLA
Modified: 2010-11-08 07:54 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***