...
Code Block | ||
---|---|---|
| ||
public static final int ADULT_AGE = 18; public static final int ALCOHOL_AGE = 21; |
...
Applicability
Failure to properly encode relationships in constant declarations can lead to unexpected values and can complicate maintenance.
Guideline | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
DCL57-JG | low | unlikely | high | P1 | L3 |
Automated Detection
Automated detection is not currently feasible.
Related Guidelines
C Secure Coding Standard: DCL08-C. Properly encode relationships in constant definitions
C++ Secure Coding Standard: DCL08-CPP. Properly encode relationships in constant definitions
Bibliography
[JLS 20052011] §4.12.4, "final
Variables"
...