NAMING.GETB
Getter methods name should start with 'is'
Description
This rule flags any getter method that has an unconventional name format.
Names of getter methods that return "boolean" values should start with 'is'.
Example
package NAMING;
public class GETB {
public boolean method() { // violation.
return _ready;
}
private boolean _ready = false;
}
Repair
Change accessor method name to is<field name>.
package NAMING;
public class GETB {
public boolean isReady() {
return _ready;
}
private boolean _ready = false;
}
Reference
http://www.AmbySoft.com/javaCodingStandards.pdf
|