...
Detection of integer literals that have a leading zero is trivial. However, determining whether the programmer intended to use an octal literal or a decimal literal is infeasible. Accordingly, sound automated detection is also infeasible. Heuristic checks may be useful.
Automated Detection
Tool | Version | Checker | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
SonarQube Java Plugin |
| S1314 S818 |
Bibliography
Puzzle 4, "It's Elementary" | |
[JLS 2013] | |
[Seacord 2009] | DCL02-C. Use visually distinct identifiers |
[Unicode 2013] |
...