File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Response from SUN on JLS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Response from SUN on JLS" Watch "Response from SUN on JLS" New topic

Response from SUN on JLS

Brian Lugo
Ranch Hand

Joined: Nov 10, 2000
Posts: 165
I am posting the response I received from SUN regarding my inquiry for clarification of the code listed in JLS, my email is indicated by ">" followed by their response:
>Would it be possible for me get clarification on the language used in the Java
>program comments in the code mentioned in Section 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
>Would you be able to point me to "errata" for the above mentioned book on the
I need to put out an errata page. The location exists - it just hasn't any
information in it:
>Looking foward to hearing from you,
Valentin Crettaz
Gold Digger

Joined: Aug 26, 2001
Posts: 7610
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 ]

[Blog] [Blogroll] [My Reviews] My Linked In
Brian Lugo
Ranch Hand

Joined: Nov 10, 2000
Posts: 165
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 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.
PS - Check out the comments by Junilu in this thread:

[ February 12, 2002: Message edited by: Brian Lugo ]
[ February 12, 2002: Message edited by: Brian Lugo ]
I agree. Here's the link:
subject: Response from SUN on JLS
It's not a secret anymore!