Discourage property names starting with a single lowercase letter followed by an uppercase letter

Property with names starting with a single lowercase letter followed by an uppercase letter (e.g. “eMail”) have broken conventions for getters and setter, with some tools expecting one form (getEMail) and others expecting a different one (geteMail).
See this issue on the lombok project for more informations, but in short java.beans.PropertyDescriptor is inconsistent with the JavaBeans specifications.

Such property names should therefore be discouraged as code smells.

Any news about this suggestion?

Hello @gbaso,

Thanks for your feedback and sorry for such a late reply. Indeed your suggestion does make sense. However, there is already a rule RSPEC-116 about “bad property names” and you can customize the format with your own regex.

Regards,
Margarita

Hello @Margarita_Nedzelska, thank you for your reply.
I’ll take a look at RSPEC-116!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.