...
Failure to ensure that the keys used in a comparison operation are immutable can lead to nondeterministic behavior.
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
MET11-J | Low | Probable | High | P2 | L3 |
Automated Detection
Some available static analysis tools can detect instances where the compareTo()
method is reading from a nonconstant field.
Tool | Version | Checker | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
Parasoft Jtest |
| CERT.MET11.IKICO | Ensure that keys used in comparison operations are immutable |
Bibliography
...
...