...
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.
Bibliography
Puzzle 4, "It's Elementary" | ||
[JLS 2011] | ||
[Seacord 2008] | ||
[ | JLS 2011]§3.10.1, "Integer Literals"Unicode 2013] |