This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
I am posting the response I received from SUN regarding my inquiry for clarification of the code listed in JLS 220.127.116.11, my email is indicated by ">" followed by their response: >Howdy! Hello >Would it be possible for me get clarification on the language used in the Java >program comments in the code mentioned in Section 18.104.22.168 of Java Language >Specification Edition 2. >I am specifically talking about the comments appearing in the "class >UseBeforeDeclaration" class. >It appears to me some of the comments are ambigious. You may want to compile >the code and check it for yourself. This is the spec; the compiler doesn't define it, it defines the compiler. In particular, compilers may be buggy and not conform to the spec. I believe this is the case wrt to this example. We need to revisit it, and decide whether to enforce the spec and fix our compiler (and mandate others to fix theirs) or whether existing implementations agree enough to define a de-facto spec on this issue, and revise the spec accordingly. >Also, I could not find the "errata" section >for Java Language Specification book at the Java Developer Connection web >site. >Would you be able to point me to "errata" for the above mentioned book on the >internet? I need to put out an errata page. The location exists - it just hasn't any information in it: http://java.sun.com/docs/books/jls/clarifications-2-2nd-ed.html >Looking foward to hearing from you, >Brian
Yep, that's the way it is. The spec is not made after the compiler but The compiler is built on the spec and if it (the compiler) doesn't fully comply with the spec then Sun decides whether the compiler is good enough that way or not (read changing a compiler and making other vendors change theirs costs a lot of money ) I guess we have to cope with that. The JLS states how every Java compiler should behave. If your compiler doesn't behave as expected, then there is probably a bug. [ February 12, 2002: Message edited by: Valentin Crettaz ]
Hi Valentin! I agree, but the specs themselves have bug to begin with. That is not good at all. The code mentioned in the Section 22.214.171.124 does not even conform to specs. Anyways, this means that you cannot trust every word/sentence mentioned in JLS. You have to verfiy that by writing the code and executing it on a given compiler. Brian PS - Check out the comments by Junilu in this thread: http://www.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=24&t=014681
[ February 12, 2002: Message edited by: Brian Lugo ] [ February 12, 2002: Message edited by: Brian Lugo ]