Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Probably dumb question on getter/setter camel case conventions
Probably dumb question on getter/setter camel case conventions [message #692118] Sun, 03 July 2011 16:23 Go to next message
dphaynes Mising name is currently offline dphaynes Mising nameFriend
Messages: 3
Registered: July 2011
Location: MT
Junior Member
When I use Source -> Generate Getters and Setters..., if the field is 'final' then it generates getSomepropertyname() {...} but without 'final' it generates getSomePropertyName() {...}

I checked and both Helios and Indigo do this, so I'm assuming this is some old Java convention/EJB requirement but I can't find any explanation on google.

Is there some historical reason that final getter/setter names aren't camel-cased?



Re: Probably dumb question on getter/setter camel case conventions [message #692173 is a reply to message #692118] Sun, 03 July 2011 19:42 Go to previous messageGo to next message
Michael Pellaton is currently offline Michael PellatonFriend
Messages: 289
Registered: July 2009
Senior Member
Hi

Funny, I cannot reproduce that.

public class Foo {
private final int fooFoo = 1;
private int barBar = 2;
}

now, Source > Generate Setters and Getters. I get:

public int getFooFoo() {...}
public int getBarBar() {...}
public void setBarBar(int barBar) {...}

Are you sure your code templates are not messed up or so...

Michael
Re: Probably dumb question on getter/setter camel case conventions [message #692190 is a reply to message #692173] Sun, 03 July 2011 21:15 Go to previous message
dphaynes Mising name is currently offline dphaynes Mising nameFriend
Messages: 3
Registered: July 2011
Location: MT
Junior Member
I haven't found anything in any of the templates or on the web or help files that seem related to camel casing identifiers. The template only allows (as far as I know) the format of the code inside the getter body, not the getter declaration itself.

Also I don't know how the templates would behave differently only when 'final' is in the declaration. That's why I assumed that it is some option or behavior coded into Eclipse.

You're right though, it must be some preference setting somewhere because I just tried it with a stock Indigo distribution and it doesn't show the same behavior.

I've been carrying the same .epf around with me probably since 3.2 or 3.3 so it's either something in there or else one of the plugins I'm using is doing it.

I exported my preferences and grepped for 'setter', 'getter', 'case' and 'final' but I don't see anything that looks like it's related.

I've got a fair number of plugins: PMD, findbugs, mylyn, data tools, subclipse, wireframe sketcher, pydev, emma, atlassian connector for jira, filesync, openjpa, PDT, WTP, dali JPA, RAP, checkstyle and probably a couple of others. I wonder if one of them is doing it?

Thanks!

Dan




Previous Topic:internal browser doesn't work
Next Topic:Shortcut for moving to the end of the current line
Goto Forum:
  


Current Time: Fri Apr 26 14:36:36 GMT 2024

Powered by FUDForum. Page generated in 0.08617 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top