Getter methods for boolean type properties

When generating a getter method for a boolean field (e.g. "valid"), IDEA automatically generates names the method "isValid()" even though it accepts a the name "getValid()" for a property getter method.

Is is possible to configure IDEA to generate methods with the latter name? (If not, I will enter it in the tracker.)

Thanks,
Jens

1 comment

When generating a getter method for a boolean field
(e.g. "valid"), IDEA automatically generates names
the method "isValid()" even though it accepts a the
name "getValid()" for a property getter method.


The generally accepted convention for naming accessor (getter) methods that return boolean values is that they are prefixed with 'is' rather than 'get'. Therefore, Idea is correct in what it is doing.

You appear to be requesting the ability to have Idea generate non-standard method names. If this is what you want I would suggest the simpler solution is to merely overtype the names generated by Idea with you own preferences rather than to change Idea.

Vince.

0

Please sign in to leave a comment.