Remove Suffix from Getter and Setter option

92 views
Skip to first unread message

Dennis

unread,
Aug 19, 2021, 1:30:33 PM8/19/21
to Project Lombok
A lot of programmers use suffixes for class member variables like 

_classMember or
mClassMember

generating a @Getter would return getMClassMember but we do not want the m inside the @Getter. 

Wouldn't it be a nice feature to have an option to remove those suffixed from out Getters?

Chris Becker

unread,
Aug 20, 2021, 11:05:22 AM8/20/21
to project...@googlegroups.com
Yes, would be nice for Lombok, too.
Eclipse and some other IDEs already handle that reliably when auto-creating code.
But I guess the user would have to set those settings himself, because converting any mXxxx (with X being any capital letter) might also do something really really unwanted.
Also remember capitalization and acronyms...

--
You received this message because you are subscribed to the Google Groups "Project Lombok" group.
To unsubscribe from this group and stop receiving emails from it, send an email to project-lombo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/project-lombok/a7f71ea9-6271-46d8-971f-6c4ef881e4c5n%40googlegroups.com.


--
Christian Becker
+49.176.2238 9755
chris.b...@gmail.com

Thorsten Glaser

unread,
Aug 20, 2021, 4:58:10 PM8/20/21
to project...@googlegroups.com
On Fri, 20 Aug 2021, Chris Becker wrote:

> > A lot of programmers use suffixes for class member variables like
> >
> > _classMember or
> > mClassMember

But why? That makes no sense, especially as the slots are already
namespaced-ish by beginning with a lowercase letter in Java™.

> But I guess the user would have to set those settings himself, because
> converting any mXxxx (with X being any capital letter) might also do
> something really really unwanted.

Yes, please do make this opt-in. I can see 'mDNSResponder' explode,
and possibly others.

bye,
//mirabilos
--
Infrastrukturexperte • tarent solutions GmbH
Am Dickobskreuz 10, D-53121 Bonn • http://www.tarent.de/
Telephon +49 228 54881-393 • Fax: +49 228 54881-235
HRB AG Bonn 5168 • USt-ID (VAT): DE122264941
Geschäftsführer: Dr. Stefan Barth, Kai Ebenrett, Boris Esser, Alexander Steeg

*************************************************

Mit dem tarent-Newsletter nichts mehr verpassen: www.tarent.de/newsletter

*************************************************
Reply all
Reply to author
Forward
0 new messages