I use JLS extensively both as a learning and teaching resource, but I've noticed that there are some errors in it.
There's the simple typos (e.g. JLS 5.1.4 "convesions"), but there's also some that I consider quite serious errors.
For example, JLS 18.1 The Grammar of the Java Programming Language is supposed to be the authoritative reference for the grammar of the Java language, but it contains a production rule that never gets used! (e.g. MoreStatementExpressions
). Surely this is a sign of more serious errors in other parts of the given grammar, right?
So is there an errata for the 3rd edition? Will there ever be? Should we send errors we've found to Sun/Oracle? Will there ever be a 4th edition?
The best I can find is the "Maintenance Review of JSR 901 (Java(tm) Language Specification) for Java SE 7".
However, the problems that the OP is concerned about are hardly serious ...
Surely this is a sign of more serious errors in other parts of the given grammar, right?
I'd say "Wrong" on this. An unused production is little more than a typographical / editing error. It makes no difference to the meaning of the Java grammar.
FWIW: Oracle's main JLS page has no mention of the JSR 901 revision effort (which has apparently finished!) and that the link for providing feedback on the JLS is broken.
I have also been burned by problems with the grammar in JLS chapter 18, and by problems elsewhere in the JLS. Although many Java programmers may not be affected by them, these are not trivial problems when you are building a compiler or program analysis tool.
Many of the problems with the JLS have been fixed in the latest version of the JLS ("JLS, Java SE edition" or, informally, "JLS 4th edition"). In particular, chapter 18 (the Java grammar) has been completely revised and reorganized.
You can find the latest JLS at the Java SE Specifications download page (direct link to JLS PDF).
UPDATE Feb 18, 2012: As described at https://blogs.oracle.com/abuckley/en_US/entry/jls7_and_jvms7_online, the Java SE 7 Editions of the Java Language Specification and the JVM Specification are now available at http://docs.oracle.com/javase/specs/ in both PDF and HTML form.
来源:https://stackoverflow.com/questions/2661210/errata-for-java-language-specification-3rd-edition