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. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.


Color Key: Serious Technical Mistake Minor Technical Mistake Language or formatting error Typo Question



Version Location Description Submitted By Corrected
Printed Page viii
2nd paragraph, line 7

... that encourage woman to ...
should be:
... that encourage women to ...

Anonymous 
Printed Page viii
4th paragraph

"trying to restoring"
should be:
"trying to restore"

Anonymous 
Printed Page ix
3rd paragraph

runing
should read:
running

Anonymous 
Printed Page xxxi
Fourth through ninth numbered Item

Items are numbered 1,2,3,5,..,10
instead of 1,2,3,4,5,..,10.

Anonymous 
Printed Page xxxv
2nd Paragraph

A space is missing between the word 'their' and the following opening parenthesis.
So this:
"...and the impact you've had on their(and our) lives is forever."
should be:
"...and the impact you've had on their (and our) lives is forever."

Anonymous 
Printed Page 5
Box for RubberDuck

The string ".//" should be "//"

Anonymous 
Printed Page 9
beneath the box containing the Design Principle

thruoghout
should be:
throughout

Anonymous 
Printed Page 12
last line

Should be a.makeSound();

Anonymous 
Printed Page 13
Box for Quack class

quack)
should be
quack()

Anonymous 
Printed Page 13
Diagram - annotation below FlyNoWay box

"And here's the implementation of all ducks that can't fly."
should be
"And here's the implementation for all ducks that can't fly."

Anonymous 
Printed Page 14
Second sentence in the second answer iin the Q&A on page 14 should

be changed to read:
"As you'll see once we've got everything hooked together, we do benefit
by having Duck not be an interface, and having specific ducks, like
MallardDuck, inherit common properties and methods."

Anonymous 
Printed Page 19
description of step 3, 3rd line

... and Sqeak.java ...
should be:
... and Squeak.java ...

Anonymous 
Printed Page 21
Code

The code is improperly indented, starting with the fourth line.

Anonymous 
Printed Page 21
step 5, console, last line

I'm flying with a rocket
should be (in order to be consistent with the code at the bottom of the previous page):
I'm flying with a rocket!

Anonymous 
Printed Page 23
Master and Student dialogue

Master's second-to-last remark includes "maintaintability"
it should be:
maintainability

Anonymous 
Printed Page 32
Middle of page, "OO Principles" box, 2nd sentence

"Favor composition over inheritence"
should be
"Favor composition over inheritance"

Anonymous 
Printed Page 33
Crossword puzzle

There were several errors in the crossword puzzle. A corrected version can be found here -
http://examples.oreilly.com/9780596007126/chapter1crossword.pdf

Anonymous 
Printed Page 35
Sharpen Your Pencil Solution

There are two "C" boxes. The boxes should be A, B, C, D, E, F instead of A, B, C, C, D, E.

Anonymous 
Printed Page 41
Second bullet

The closing parenthesis is missing.

Anonymous 
Printed Page 52
Q&A section at bottom

Minor layout booboo: missing "There are no Dumb Questions" heading

Anonymous 
Printed Page 56
UML

"CurrentConditions" should be "CurrentConditionsDisplay" (as it is in the code on p. 60).
Also On page 56, the "subject" arrow from CurrentConditions (which should read
CurrentConditionsDisplay) should point to the Subject interface, rather than WeatherData.

Anonymous 
Printed Page 64
UML

On page 64, the "subject" arrow from GeneralDisplay should point to Observable rather
than WeatherData.

Anonymous 
Printed Page 65
last paragraph

notifyObserver(arg)
should read:
notifyObservers(arg)

Anonymous 
Printed Page 78
In the Code Magnets solution, the line -

Weatherdata weatherData = (WeatherData)observable;

should not appear in the ForecastDisplay constructor, as it does now, but rather
as the first line in the update() method.


Anonymous 
Printed Page 87
3rd answer, near middle of paragraph

would probably be wastefu). Following
should be:
would probably be wasteful). Following

Anonymous 
Printed Page 87
last A, first sentence

remove extra "the" before "knowing the domain"

...in designing OOP systems and also a matter of the knowing the domain...
should be:
...in designing OOP systems and also a matter of knowing the domain...

Anonymous 
Printed Page 91
The two ConcreteDecorators

ConcereteDecoratorA and ConcereteDecoratorB
should be:
ConcreteDecoratorA and ConcreteDecoratorB

Anonymous 
Printed Page 91
bottom left bullet text

"The ConcreteDecorator has an instance variable for the thing it decorate..
should be:
"The ConcreteDecorator has an instance variable for the thing it decorates."

Anonymous 
Printed Page 94
in the first paragraph,

the word
"lotte"
should be:
"latte"

Anonymous 
Printed Page 96
Third annotation down on Espresso, second sentence

"Now that we don't need to worry about ..."
should read just
"We don't need to worry about ..."

Anonymous 
Printed Page 96
Annotation at the bottom of the page

"You can create the other three Beverage classes (DarkRoast, Decaf, Esperesso)
in exactly the same way.
should read:
"You can create the other two Beverage classes (DarkRoast and Decaf) in exactly the same way.

Anonymous 
Printed Page 98
Starred annotation under the code

We're going to see a much better way of creating decorated objects when we cover the
Factory and Builder Design Patterns.
add to the existing annotation:
Please note that the Builder Pattern is covered in the Appendix.

Anonymous 
Printed Page 99
Question 1

"specfic"
should be:
"specific"

Anonymous 
Printed Page 99
second Q paragraph


At the end of the second Question paragraph, it says "which means it would not
including Whip in the order."

That should be "include" instead of "including."

Anonymous 
Printed Page 99
Last Question

The second sentence says "Say, I wanted my getDecription..."
it should say: "Say, I wanted my getDescription..."

Anonymous 
Printed Page 99
Last Answer

The last sentence says "Note that getDecription..."
it should say: "Note that getDescription..."

Anonymous 
Printed Page 106
1st box

public float cost(){
should be:
public double cost(){

Anonymous 
Printed Page 106
in the bottom solution box at the very top

"double mocha soy lotte with whip"
should be:
"double mocha soy latte with whip"

Anonymous 
Printed Page 107
getSize method of Soy class

public getSize() {
SHOULD BE:
public int getSize() {

Anonymous 
Printed Page 109
last line

embarrasing -> embarrassing

Anonymous 
Printed Page 113
last line in highlighted block of code.

pizza = new eggiePizza();
should be:
pizza = new VeggiePizza();

Anonymous 
Printed Page 114
last 3rd line in last paragraph

a client of that object. Any time it needs a pizzam it asks
should be:
a client of that object. Any time it needs a pizza it asks

Anonymous 
Printed Page 115
bottom right, answer to last question

"But remember it also has the disadvanage..."
should be:
"But remember it also has the disadvantage..."

Anonymous 
Printed Page 117
Bottom "Just another reminder:.." Second line;

"write a class the implements ...
should be
"write a class that implements ...

Anonymous 
Printed Page 119
third line in the two listings

line 3: There should be "nyStore.orderPizza" instead of "nyStore.order"

line 6: There should be "chicagoStore.orderPizza" instead of "chicagoStore.order"

Anonymous 
Printed Page 120
last line in code example

abstract createPizza(String type);
should be:
abstract Pizza createPizza(String type);

Anonymous 
Printed Page 121
Second paragraph

Erroneous space after first "thick".

Anonymous 
Printed Page 130
black output window at the bottom

"Grated Regiano cheese"
should be:
"Grated Reggiano Cheese"
[in order to match the code shown on page 129]

Anonymous 
Printed Page 134
Last paragraph

The last sentence should start with
'They say "decide"'

Anonymous 
Printed Page 144
Last paragraph

"different set that needs to shipped..."
should be
"different set that needs to be shipped..."

Anonymous 
Printed Page 145
in the California group;

the seafood should be "Calamari", not "Camari"

Anonymous 
Printed Page 148
UML drawing of classes at the bottom of the page

"Mozzarella" class name should be "MozzarellaCheese" (to match p. 145)

Anonymous 
Printed Page 150 & 151
last method

Wrong way double-quotes

Anonymous 
Printed Page 159
2nd paragraph, right column (Abstract Factory)

"...because I am used to create entire families..."
should read:
"...because I am used to creating entire families..."

Anonymous 
Printed Page 160
text floating in bottom-middle of diagram

"Subclasses are instaniated
by the Factory Methods."

It should be

"Subclasses are instantiated
by the Factory Methods."

Anonymous 
Printed Page 162
Abstract Factory Card

depedent
should be:
dependent

Anonymous 
Printed Page 173
floating "a" inside "Watch it" box on the top right of the page

"you'll see a
it has a few issues
later in the chapter".

It should be

"you'll see
it has a few issues
later in the chapter"

Anonymous 
Printed Page 175
fill method

"fill" is rendered improperly (with a hard-to-read font)

Anonymous 
Printed Page 179
"Bet the JVM" code example

code example;
ChocolateBoiler boiler =
ChocolateBoiler.getInstance();
fill();
boil();
drain();
should be:
ChocolateBoiler boiler =
ChocolateBoiler.getInstance();
boiler.fill();
boiler.boil();
boiler.drain();

(204, Text above the black box on the bottom-right of the page:

"Here, create a command and pass it to the receiver."
it should be :
"Here, create a command and pass the receiver to it."

Anonymous 
Printed Page 207
in the text pointing to the Command interface,

the word should be "perform", not "preform"

Anonymous 
Printed Page 208
Second paragraph, Sue's statement

Sue's last sentence ends with a colon, but no example follows it.

After the colon at the end of Sue's statement, add:

"onCommands[0] = onCommand;
offCommands[0] = offCommand;

and so on for each of the seven command slots."

Anonymous 
Printed Page 209
swapped letters "ie" in "reciever", bottom right of the page

"(3) In the execute() method actions
are invoked on the reciever."

It should be:

"(3) In the execute() method actions
are invoked on the receiver."

Anonymous 
Printed Page 212
first paragraph

"Home Automation of Bust" should be "Home Automation or Bust"

Anonymous 
Printed Page 216
In the thought bubble

Printed:

Note from the Author or Editor:
Should replace "!!!!" with "?!"

B Hillebrecht 
Printed Page 223
RemoteLoader output window

The output in the window on page 223 does not match the code on page 222.

Code has
remoteControl.setCommand(0, ceilingFanMedium, ceilingFanOff);
remoteControl.setCommand(1, ceilingFanHigh, ceilingFanOff);

The output window has:
[slot 0] headfirst.command.undo.NoCommand headfirst.command.undo.NoCommand
[slot 1] headfirst.command.undo.CeilingFanMediumCommand headfirst.command.undo.CeilingFanOffCommand
[slot 2] headfirst.command.undo.CeilingFanHighCommand headfirst.command.undo.CeilingFanOffCommand

but should be:
[slot 0] headfirst.command.undo.CeilingFanMediumCommand headfirst.command.undo.CeilingFanOffCommand
[slot 1] headfirst.command.undo.CeilingFanHighCommand headfirst.command.undo.CeilingFanOffCommand
[slot 2] headfirst.command.undo.NoCommand headfirst.command.undo.NoCommand

Anonymous 
Printed Page 230
1st bullet point

"The Command Pattern decouples an object, making
a request from the one that knows how to perform it."

remove comma

Anonymous 
Printed Page 230
5th bullet point

"excute()" should be "execute()"

Anonymous 
Printed Page 233
undo() definition of top exercise

The boxed text reads:
"for (int i = 0; i < commands.length; i++) {
commands[i].undo();
}"
The commands need to be undone in *reverse* order, like so:
"for (int i = commands.length - 1; i >= 0; i--) {
commands[i].undo();
}"

Anonymous 
Printed Page 240
Test run at the bottom

Replace RemoteControlTest with DuckTestDrive and remove newlines that are not in the
code:

%java DuckTestDrive
The Turkey says...
Gobble gobble
I'm flying a short distance

The Duck says...
Quack
I'm flying

The TurkeyAdapter says...
Gobble gobble
I'm flying a short distance
I'm flying a short distance
I'm flying a short distance
I'm flying a short distance
I'm flying a short distance

Anonymous 
Printed Page 245
first paragraph

")." should be ".)"

Anonymous 
Printed Page 278
Top of page, annotation next to prepareRecipe(), 2nd sentence

"the second and forth steps are different, ..."
should be
"the second and fourth steps are different, ..."

Anonymous 
Printed Page 292
first "handwritten" comment

"a condiments" should be "condiments"

Anonymous 
Printed Page 295
bottom right of page, last paragraph

"so you can implement these as hooks rather than abstract classes,"

It should be:

"so you can implement these as hooks rather than abstract methods,"

Anonymous 
Printed Page 298
third description in Who Does What? box

"Subclasses decide which concrete classes to create."

It should be:

"Subclasses decide which concrete classes to instantiate."

Anonymous 
Printed Page 300
first "handwritten" comment

"paired" should be "pared"

Anonymous 
Printed Page 308
first "Template Method" paragraph

Missing terminating period

Anonymous 
Printed Page 321
bullet item #1

"...you'll need to call the getMenuItem() method ..."
should be:
"...you'll need to call the getMenuItems() method ..."

Anonymous 
Printed Page 321
second code excerpt

Improper facing closing double-quotes

Anonymous 
Printed Page 322
Sharpen your pencil box

Items are lettered A, B, C, C, D, E. Should be A, B, C, D, E, F.

[328 + 330] 1st paragraph, 2nd sentence;
The "getIterator()" text on pages 328 and 330 (first paragraph, both pages)
should be replaced with "createIterator()"

Anonymous 
Printed Page 332
last line, first column

you'llwant
should read:
you'll want

Anonymous 
Printed Page 338
3rd Question

"Could I implement an Iterator that can go backwards as well as backwards?"
should be:
"... backwards as well as forwards?"

Anonymous 
Printed Page 350, 382
6th magnet

The code
position = rightNow.DAY_OF_WEEK % 2;
should be:
position = rightNow.get(Calendar.DAY_OF_WEEK) % 2;

Anonymous 
Printed Page 354
1st paragrah

second to the last line of paragraph:
"... chefs that the time as come for us..."
should be
"... chefs that the time has come for us..."

Anonymous 
Printed Page 365
Description for Apple Pie on the desertMenu definition

"icecream" should be "ice cream"

Anonymous 
Printed Page 365
Second hand-written comment from the top

Text states:
"We also need two top level menu now that we'll name allMenus."

Corrected Version:
"We also need a top level menu that we'll name all Menus."

Anonymous 
Printed Page 374
Description for Apple Pie on the menu printout (in two places)

"icecream" should be "ice cream"

Anonymous 
Printed Page 378
11 down:

Hashtable and ArrayList both implement this interface.
Should be:
ArrayList implements this interface.

Anonymous 
Printed Page 379
Who Does What?

Replace the text "State Pattern" at the top left of the diagram with "Strategy Pattern",
and replace the description on the bottom right of the page, "Allows an object to
change its behavior when some state changes" with "Encapsulates
interchangeable behaviors and uses delegation to decide which one to use."

Anonymous 
Printed Page 381
Sharpen your pencil solution box

Items are lettered A, B, C, C, D, E. Should be A, B, C, D, E, F.

Anonymous 
Printed Page 392
first sentence

A comma is missing after "methodology".

Anonymous 
Printed Page 396
Sharpen your pencil box

Items are lettered A, B, C, C, D, E. Should be A, B, C, D, E, F.

Anonymous 
Printed Page 397
repeated "this" in second to last sentence by Joe

"I wonder if this will this make it easier to add new states?"
It should be:
"I wonder if this will make it easier to add new states?"

Anonymous 
Printed Page 425
Sharpen your pencil box

Items are lettered A, B, C, C, D, E. Should be A, B, C, D, E, F.

Anonymous 
Printed Page 428
Top (Who does What)

The solutions for Template Method and Strategy are wrong;
Template Method should point to the solution that Strategy is pointing to
(i.e., the solution beginning, "Subclasses decide...")
and Strategy should point to the solution that Template Method is pointing to
(i.e., the solution beginning, "Encapsulate interchangeable behaviors...").
The solution for State is correct.

Anonymous 
Printed Page 431
code

Improper facing double-quotes

Anonymous 
Printed Page 445
Last "hand-written" note on bottom of page

The word "rmiregistery" should be "rmiregistry".

Anonymous 
Printed Page 446
Code Up Close, 1st "callout"

Book says:
"The client always uses the remote implementation as the type of the service."
Should say:
"The client always uses the remote interface as the type of the service."

Anonymous 
Printed Page 455
GumballMonitorTestDrive code

As written, the GumballMonitorTestDrive will fail with a NullPointerException if a GumballMachineRemote fails to initialize.

If Naming.lookup() throws a RemoteException for the the second location, the second index in the GumballMonitor[] will remain null.

Later, you loop over all the elements in GumballMonitor[] and call report() -- which will throw a NullPointerException on the second index.

Your example should have (at the very least) done a null check on the array elements. Or (even better) used a Collection<GumballMonitor> and iterated over elements added only if the Naming.lookup() was successful.

Note from the Author or Editor:
Yes, we should check for a null pointer. But in this example, we can assume that the remote will always start correctly.

Anonymous 
Printed Page 456
Code execution windows at the bottom of the page

java GumballMachine santafe.mightgumball.com 100
should be:
java GumballMachineTestDrive santafe.mightgumball.com 100

Anonymous 
Printed Page 457
Code execution window

java GumballMonitor
should be:
java GumballMonitorTestDrive

Anonymous 
Printed Page 507
System.out.println() line in code

The message text in the System.out.println() statement does not match the output in the window below.
Code has "The ducks quacked <n> times".
The output window has "<n> quacks were counted".

This error also occurs in several other downstream pages, 510 and 514 at least.

Anonymous 
Printed Page 521
Step 18

Second sentence should read "Let's update the simulator and give it a try:" not "...give it try:"

Anonymous 
Printed Page 526
bottom paragraph, first column

"applications" should be "application's"

Anonymous 
Printed Page 527
second to last stanza in left column

"repititious" should be "repetitious"

Anonymous 
Printed Page 557
1st paragraph, 2nd to last sentence

minor typo:
"and displayed in a seb browser."
should be
"and displayed in a web browser."

Anonymous 
Printed Page 591
bottom right answer on the page

remove the sentence:
"It's a subtle distinction, especially when you consider the structural
similarities between Decorator (a structural pattern) and Proxy (a
behavioral pattern)."

Anonymous 
Printed Page 620
repetition production

Improper facing single quote to the right of the left parenthesis.

Anonymous 


"One of the funniest and smartest books on software design I've ever read."
--Aaron LaBerge, VP Technology, ESPN.com