Originally posted by Avi Abrami:
According to my reckoning, you have five grammatical and spelling mistakes in the (book) excerpt that you posted. That's an average of almost two mistakes per paragraph. Did you post the excerpt from memory, or is this the actual text as it appears in the book? Pardon me, but that implies (to me) a low level of professionalism on the part of the book's publishers. Is there an errata page where people can draw attention to mistakes found in the book? Perhaps we can hope that the next printing of the book will contain less mistakes.
Originally posted by Jim Yingst:
The difference being that the API for get() in Map says clearly: "Returns: the value to which this map maps the specified key, or null if the map contains no mapping for this key." Very well-defined. Whereas Pattern's matcher() says: "Returns: A new matcher for this pattern." Also very clear and well-defined, IMO. How can the latter method possibly return null, and still implement the API? Of course we've been known to disagree on interpretation of specs once or twice in the past.
As a matter of fact, the earliest 1.4 JDKs had a habit of not doing this. It's only in 1.4.1+ that they started to change that behavior.
Copied from src.zip in JDK 1.4.0:
This is unchanged in 1.4.2 and 1.5 beta. I don't have a copy of a 1.4 beta handy; perhaps those were more buggy. Though there don't seem to be any relevant bug reports in Sun's database.