Java Fundamental Classes Reference by Mark Grand & Jonathan Knudsen This errata page lists errors outstanding in the most recent printing, 6/97. If you have tehcnical questions or error reports, you can send them to booktech@oreilly.com. (Please specify the printing date of your copy.) This page was updated on October 28, 1998. Here's the key to the markup: [page-number]: serious technical mistake {page-number}: minor technical mistake : important language/formatting problem (page-number): language change or minor formatting problem ?page-number?: reader question or request for clarification Confirmed errors: {43} line 1 array.length % hashCode() should say hashCode() % array.length [71] The second paragraph should be replaced with the following text: Some sets of objects are more complicated to reconstruct than an instance of the above class and its RandomAccessFile object. In such cases the information to reconstruct objects may be spread out over multiple objects in the set. It is not possible to reliably do such validations from an object's readObject method, because there is no way to know that all of the objects needed for the validation have already been deserialized. The ObjectInputStream class has a mechanism for handling this situation. Objects that need to perform mutli-object validations can call the ObjectInputStream object's registerValidation. The registerValidation method is passed an object that implements the ObjectInputValidation interface and a numeric priority. Here is the declaration of the ObjectInputValidation interface. public interface ObjectInputValidation { public void validateObject() throws ObjectInvalidException; } After an ObjectInputStream object's readObject method reads a set of objects, but before it returns, it calls the validateObject method of all the objects passed to its registerValidation method. If any of those validateObject methods are unable to properly reconstruct something or detect an consistency of some sort, then they should throw an ObjectInvalidException. Note that the order in which the objects' validateObject method is called is determined by the priority value that was passed into registerValidation along with the ObjectInputValidation object. Higher priorities are called before lower priorities. Withing the same priority value, there is no specified order. (This change might not be made until the a second edition becuase it would upset the text flow across many pages.- production editor) {96} code -1: getRuntime().exec("copy foo.ps lpt1:"); should be getRuntime().xexec("copy foo.ps lpt1:"); to work on Windows 95. {182} FileReader under Constrcutors - FileInputStream should read FileReader as the header for FileReader {408} The Description paragraphs for getSystemResource and getSystemResourceAsStream conclude with a sentence that says: The resource name can be any system resource. Instead it should say: This method finds a system resource by looking for a file with the given name. It looks for the given file name relative to the directories and zip file in the CLASSPATH specification. If the argument to this method includes any directory names, they should be separated from what follows them by a '/' character. {423} and {427} Neither Double toString nor static toString(double) print 8 digits. It should say seven rather than eight digits. That will be true for both Float and Double. {483} The sentence that says: It computes as the principle value of the arc tangent of b/a, using the signs of both arguments to determine the quadrant (and sign) of the return value. should say: It computes as the principle value of the arc tangent of a/b, using the signs of both arguments to determine the quadrant (and sign) of the return value. Note that some versions of Java prior to 1.1 incorrectly computed Math.atan2 as the arc tangent of b/a. {659} under the "Instance Methods" heading, the heading "getName" should be "getTargetException" {692} under the heading "modPow", the method declaration should say "modPow" instead of "modInverse" {792} Figure 16-1 shows STringCharacterIterator as extending BreakIterator. It does not. It is a subclass of object. {783} line 1 should be Jean-Louis+Gass%8ee (890) Description paragraph, line 2 (" class implements...") should be run up to line 1 {918} the description under "getYear" has 1990 where it should have 1900 (946) "Locale" para. 5 is missing a period in the last line. {980} The description of the java.util.SimpleTimeZone class' setStartRule method includs an example which should be a call to setStartRule instead of a call to setEndRule. The example should be: setStartRule(Calendar.APRIL, 1, Calendar.SUNDAY, 2*60*60*100) [993] A method is missing from the description of the java.util.Vector class: public final int lastIndexOf(Object elem, int index) This method searches backward starting at the specified index of this Vector object to find an occurrence of the given object. Returns If this method finds an occurrence of the object, it returns the occurrence’s index. If this method does not find an occurrence of the given object then it returns -1. (index) There is no index entry for CLASSPATH. There should be in index entry for CLASSPATH that minimally refers to the pages that the ClassLoader class' getSystemResource, getSystemResourceAsStream and findSystemClass methods are on.