Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Strange autogenerated getter and setter in eclipse

Tags:

java

eclipse

When I use the auto generation for getter/setter in Eclipse for an class field with a name like
String lAttr it will produce this:

public String getlAttr() {
  return lAttr;
}
public void setlAttr(String lAttr) {
  this.lAttr = lAttr;
}

The first letter of the field will not be capitalized! But some frameworks which I use, work with reflection and invoke the getter/setter by using the "get" + capitalized field name.

Can I change the code generation for getter/setter in eclipse to produce an output like getLAttr() and setLAttr() ?

like image 959
timaschew Avatar asked Oct 10 '22 03:10

timaschew


1 Answers

1) I don't think it's possible, similar discussion:

Change Eclipse Getters Setters syntax

2) another option, as alternative, is to use templates for getters and setters. though there is a small problem there too, similar discussion:

How to deal with Camel Case for Eclipse Templates?

like image 53
Dmitry F Avatar answered Oct 18 '22 15:10

Dmitry F