Errata


Print Print Icon

Submit your own errata for this product.


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



Version Location Description Submitted By
Printed Page 139
start of 6th paragraph

"The third possibility, notification, is new."

This is not true. The "notify" and "notifyall"
method calls have been around for ages. I know they go
back as far as 1.1.8 (as I just checked the API docs
for that) and I suspect they may go back earlier.

Anonymous 
Printed Page 146
Example 5-15

In the GZipThread class, there is a line:
input = (File) pool.remove(pool.size()-1);

The pool is of type Vector, so it is synchronized. However, this line uses two operations on the pool, and therefore it needs to be synchronized. I suggest synchronizing on the pool, as the pool.add() method call in Example 5-16 is synchronized on the pool.

I bring this up, because the last line on page 144 says "..you have to be extremely careful about synchronization..." about this example.

The code, as written, will work on a cooperatively scheduled virtual machine, in a simple example like this, but because this chapter is teaching about synchronization, it should be corrected.

Glenn Erion 
Printed Page 252
2nd non-code line

Reference to "Example 8-5's ParserGetter class". Example 8-5 doesn't have a ParserGetter class. Example 8-6 contains the class.

Richard Levey 
Printed Page 328
Example 10-1. Look for local ports

The ServerSocket object created by the line:

ServerSocket server = new ServerSocket(port);

is never closed. The above line should be followed with something like the following
lines of code:

try
{
server.close();
}
catch (IOException ex)
{
System.out.println("Error closing socket on port " + port + ".");
}

This extra try/catch is required to distinguish close errors from bind errors that
are picked up by the existing catch block.

Anonymous 
Printed Page 343
catch (IOException ex) near end of page

Code example reads:

} catch(IOException ex) {
e.PrintStackTrace();
}

There is no "e" in that Exception...

Anonymous 
Printed Page 368
at the beginning of page

I think the method public abstract Socket createSocket(InetAddress host, int port,
InetAddress interface, int localPort) shouldn't throw UnknownHostException.

Although the next method public abstract Socket createSocket(Socket proxy, String
host, int port, boolean autoClose) should throw that UnknownHostException.

So I think the two methods should be printed like this:-

public abstract Socket createSocket(InetAddress host, int port, InetAddress
interface, int localPort) throws IOException

public abstract Socket createSocket(Socket proxy, String host, int port, boolean
autoClose) throws IOException, UnknownHostException

Anonymous 
Printed Page 368
at the beginning of page

I noticed a small error in O'Reilly Java Network Programming 3rd Edition.
The error is at the beginning of page 368 of the hardcopy.

I think the method public abstract Socket createSocket(InetAddress host, int port,
InetAddress interface, int localPort) shouldn't throw UnknownHostException.

Although the next method public abstract Socket createSocket(Socket proxy, String
host, int port, boolean autoClose) should throw that UnknownHostException.

So I think the two methods should be printed like this:-

public abstract Socket createSocket(InetAddress host, int port, InetAddress
interface, int localPort) throws IOException

public abstract Socket createSocket(Socket proxy, String host, int port, boolean
autoClose) throws IOException, UnknownHostException


Thanks again for that nice book.

Tareq Jahhaf.

Anonymous 
Printed Page 444
in paragraph 3

It's in the hardcopy on page 444 in paragraph 3.
The title of the paragraph is:-
public InetAddress getRemoteSocketAddress( )
I think the right should be:-
public SocketAddress getRemoteSocketAddress( )
The method getRemoteSocketAddress() is in class SocketAddress not in InetAddress.

Anonymous