Boolean Prefix (ARCH4007)
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Key java.naming.boolean-prefix · Severity info · Category naming
Boolean-typed fields and accessors should carry an interrogative prefix (is/has/can/should); otherwise conditionals read poorly.
Incorrect
Section titled “Incorrect”public class Account { private boolean active; public boolean active() { return active; }}Correct
Section titled “Correct”public class Account { private boolean active; public boolean isActive() { return active; }}Add an is/has/can/should prefix to boolean members and accessors.