Errata
The errata list is a list of errors and their corrections that were found after the product was released.
The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.
Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update
Version | Location | Description | Submitted by | Date submitted |
---|---|---|---|---|
Page 60 The "in = connection.getInputStream( );" source code |
The "in" variable is not defined. |
Oleg Bogriakov | Mar 28, 2014 | |
Printed | Page 90,91 chapter 6 code example DecimalFilter.java and HexFilter.java |
These two examples in fill() method that implement from class DumpFilter, but buf field in the class DumpFilter marked private so that subclass can't see it, as well as index field in the class DumpFilter. |
Anonymous | |
Printed | Page 100 9.3. Communicating Between Threads Using Piped Streams |
FibonacciDriver class must be wrong.It's the same as FibonacciConsumer.class |
Anonymous | |
Printed | Page 131 Skipping Bytes section |
The description of DataInputStream.skipBytes(int n) applies to the original specification and would have been valid for Java 1.0 and Java 1.1. However, from Java 1.2 onward the specification has changed, such that the method does not guarantee to skip over all (or any) of the requested bytes and it guarantees not to throw an EOFException. The actual number of bytes skipped is returned. |
Benjamin Morgan | Jan 20, 2018 |
Printed | Page 138 readShort method |
Due to the bit shift operator having lower precedence than the addition operator, an extra pair of brackets is required. The line: |
Benjamin Morgan | Jan 16, 2018 |
Printed | Page 138 readByte method |
The signature of the method should not include an argument. |
Benjamin Morgan | Jan 16, 2018 |
Printed | Page 140 skipBytes method |
The implementation of skipBytes is fundamentally flawed, in that it will loop forever if the skip method returns zero: |
Benjamin Morgan | Jan 19, 2018 |
Printed | Page 157 Example 9-5 |
The FibonacciDriver example contains the FibonacciConsumer code. |
Anonymous | |
Printed | Page 166 Subsection "Checking the state of a deflater" |
The text should perhaps mention that (at least according to the Java 5/6 API) the methods getBytesRead() and getBytesWritten() are preferred over getTotalIn() and getTotalOut(), as they return a long rather than an int and thus can handle larger files. |
Anonymous | |
Printed | Page 170 Subsection "Checking the state of an inflater" |
The text should perhaps mention that (at least according to the Java 5/6 API) the methods getBytesRead() and getBytesWritten() are preferred over getTotalIn() and getTotalOut(), as they return a long rather than an int and thus can handle larger files. |
Anonymous | |
Printed | Page 178 1st paragraph |
"The ZipFile class contains two constructors." must be "The ZipFile class contains three constructors." |
Anonymous | |
Printed | Page 183 Last paragraph before the section "The ZipOutputStream Class" |
In addition to the six setter methods mentioned in the text, there is a method setCompressedSize() for setting the size of the compressed entry data. |
Anonymous | |
Printed | Page 212 Method signatures after the 1st paragraph |
While the text states that the signatures for the two unpack() methods of the Pack200 class are |
Anonymous | |
Printed | Page 223 Table 12-1 |
For SHA-1 and SHA-256, "documents of less than 264 bits" should read "documents of less than 2⁶⁴ bits". |
Benjamin Morgan | Feb 04, 2018 |
Printed | Page 226 Creating Message Digests |
The third constructor, added in Java 1.4, has been omitted. |
Benjamin Morgan | Feb 05, 2018 |
Printed | Page 283 Final sentence |
SerializableZipFile was Example 13-3, not 13-6. |
Benjamin Morgan | Feb 16, 2018 |
Printed | Page 285 3rd paragraph |
"The main() method tests the program by serializing and deserializing a SerializableVector ..." |
Anonymous | |
Printed | Page 285 4th paragraph |
Sample output of 5th line (between null and 9) must be "Element 5", |
Anonymous | |
Printed | Page 315 Example 14-2 Class NIODuplicator |
Main method contains an infinite while loop. This is due to the failure to test whether more data needs to be written before invoking the compact() method on the buffer object. Automatically, invoking compact() without testing, ends up in resetting the position pointer to 0 and limit pointer to capacity which causes the 2nd test condition in the while loop (buffer.hasRemaining()) to always return true. |
Anonymous | |
Printed | Page 316 1st paragraph |
The statement, |
Anonymous | |
Printed | Page 320 bottom |
Some mistakes are in code fragment at page bottom: |
Anonymous | |
Printed | Page 321 1st paragraph |
Some mistakes are in code fragment at page top: |
Anonymous | |
Printed | Page 348 UDPTimeClient source code, first section of try block. |
A timeout is set on the DatagramChannel by invoking the setSoTimeout method on the underlying socket: |
Benjamin Morgan | Mar 12, 2018 |
Printed | Page 357 second sentence following third code example |
Sentence "Should the key become ready again in the future, is it included in the next |
Anonymous | |
Printed | Page 366 Just before final paragraph |
Copy-and-paste error: the constructor of Pipe.SourceChannel is written as "public abstract static class Pipe.SinkChannel …" |
Benjamin Morgan | Mar 14, 2018 |
Printed | Page 395 first paragraph under "Temporary Files" |
"The File class provides two [createTempFile] methods *that create temporary files that exist only as long as the program runs*" (emphasis mine) -> as the author points out further down, there is a separate "deleteOnExit" method that must be called if you want temp files (or any other files) to be deleted on exit. |
Anonymous | |
Printed | Page 395 Top half of page |
Copy-and-paste error: the boolean parameters of the Java 6 methods are all named "executable"; two should be named "readable" and two "writable". |
Benjamin Morgan | Mar 21, 2018 |
Printed | Page 397 CWDSpace source code |
The first two printed strings end with a tab character, which makes no sense; presumably the three values were originally printed on the same line, separated by tabs, before being changed to one per line. |
Benjamin Morgan | Mar 21, 2018 |
Printed | Page 411 FileTyper source code |
The FileTyper class will not print out files that consist of a single line, i.e. files with no line terminator. The following line should be added after the for-loop: |
Benjamin Morgan | Mar 28, 2018 |
Printed | Page 419 Paragraph beginning "Suppose you want a file chooser…" |
The standard Metal look and feel provides a JFileChooser that does not use mnemonics for approve and cancel. Thus, setting the mnemonic for the Approve button has no effect. Given the likelihood that the reader will execute the book's source code with a Metal look and feel, perhaps this should be pointed out. |
Benjamin Morgan | Mar 28, 2018 |
Printed | Page 421 First sentence |
FilenameFilter should be replaced by FileFilter, as used in the rest of the section. |
Benjamin Morgan | Mar 29, 2018 |
Printed | Page 439 actionPerformed method |
The following line of code will not compile: |
Benjamin Morgan | Apr 28, 2018 |
Printed | Page 456 Second paragraph |
The sentence beginning "Example 19-3 is a slightly more complex program…" actually refers to Example 19-2. |
Benjamin Morgan | Apr 30, 2018 |
Printed | Page 457 Final paragraph before Example 19-3 |
The sentence beginning "Example 19-5 is a simple program…" actually refers to Example 19-3. The error is repeated on page 458. |
Benjamin Morgan | Apr 30, 2018 |
Printed | Page 472 Paragraph introducing Example 20-2 |
The text refers to the class as FileConverter rather than its actual name StreamRecoder. |
Benjamin Morgan | May 05, 2018 |