Inspectopedia
 
2024.3

Boolean method name must start with question word

Warning
New
Last modified: 03 December 2024

Reports boolean methods whose names do not start with a question word.

Boolean methods that override library methods are ignored by this inspection.

Example:

A quick-fix that renames such methods is available only in the editor.

Configure the inspection:

  • Use the Boolean method name prefixes list to specify acceptable question words to start boolean method names with.

  • Use the Ignore methods with 'java.lang.Boolean' return type option to ignore methods with the java.lang.Boolean return type.

  • Use the Ignore boolean methods in an @interface option to ignore boolean methods in annotation types (@interface).

  • Use the Ignore methods overriding/implementing a super method to ignore methods the have supers.