getter / setter naming in Eclipse

@Tochukwu

See https://jira.spring.io/browse/IDE-337 where someone had the same problem as you.

Also https://bugs.eclipse.org/bugs/show_bug.cgi?id=154823.

The response is that Eclipse (now) does the right thing in generating method

geteMail() // not getEMail()

for field

String eMail;

It’s unfortunate that class java.beans.Introspector’s Javadoc has a reference to

http://java.sun.com/products/javabeans/docs/index.html

which is a broken link.

I haven’t tracked down a definitive statement of how Javabeans should handle a field name like “eMail”.

Introspector.decapitalize()

will convert method name geteMail() to field name eMail

but will leave method name getEMail() as for field name EMail.

Hence the former getter name is ‘correct’ for field name eMail.

So it might be that it is your other tools, not Eclipse, that are doing ‘the wrong thing’.

The moral is, probably, to ​​avoid any field names that start lower-case upper-case?

Mungo

The University of Dundee is a registered Scottish Charity, No: SC015096