Inclusive Class Definition
ID |
java.inclusive_class |
Severity |
info |
Remediation Complexity |
trivial |
Remediation Risk |
medium |
Remediation Effort |
low |
Resource |
Naming Convention |
Language |
Java |
Tags |
inclusive, naming |
Description
Reports class, interface, enum and record declarations whose name contains a non-inclusive term such as blacklist/whitelist, master/slave, grandfather, dummy or sanity.
Rationale
Non-inclusive terms carry social and historical weight that has no technical value; replacing them with neutral, intent-carrying words (allowlist/denylist, primary/replica, legacy, stub, smoke) makes the code friendlier to contributors and more precise about what it actually describes. Most industry style guides (Android, Chromium, Kubernetes, Linux kernel) have deprecated these terms.
// Bad
class UserBlacklist { ... }
class MasterDatabase { ... }
// Good
class UserDenyList { ... }
class PrimaryDatabase { ... }
Remediation
Rename the type using a neutral equivalent. Common substitutions:
-
blacklist→denylist/blocklist -
whitelist→allowlist -
master→primary/leader/main -
slave→replica/follower/secondary -
grandfather→legacy -
dummy→stub/placeholder -
sanity check→smoke test/check