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 5
4th line from the bottom to top

return guitar; is missing after continue;

it should be like:

...
if ((topWood!=null)&&(!topWood.equals("")) &&
(!topWood.equals(guitar.getTopWood())))
continue;
return guitar;
}
return null;
}
}

Anonymous 
Printed Page 6
end of second line of System.out.println in if block

guitar.getBuilder() + " " + guitar.getModel() + " "
should read
guitar.getBuilder() + " " + guitar.getModel() + " " +

Anonymous 
Printed Page 6 and 7
construction of whatErinLikes (on page 6) and inventory.addGuitar() on page 7

on page 6, we use the string "fender"
whereas on page 7, we use the string "Fender" (capital F).

Even if the Inventory.search() were correctly implemented, this difference would mean that we would not find what Erin wants
(the case of the builder string must match)

Anonymous 
Printed Page 6
Codebox

I talk about the german version of the book. In the code, the Fender guitar is a "Stratocastor" instead of a "Stratocaster".

yetibrain 
Printed Page 41
In "torn sheet" of "public Guitar(String..."

The declaration of the class Guitar is the pre-GuitarSpec one:

public Guitar(String serialNumber, double price, Builder builder, String model, Type type, Wood backWood, Wood topWood)

It seems to me it should be:

public Guitar(String serialNumber, double price, GuitarSpec spec)

If I'm somehow mistaken, it wouldbe nice if someone could let me know. Thanks!

Anonymous 
Printed Page 45
matches method

There should be getter methods for accessing the properties in the 'otherSpec' object. All method calls are made as if the properties were public.

public boolean matches(GuitarSpec otherSpec)
{
if (this.builder != otherSpec.getBuilder())
return false;
if ((model != null)
&& (!model.equals(""))
&& (!model.toLowerCase().equals(
otherSpec.getModel().toLowerCase())))
return false;
if (type != otherSpec.getType())
return false;
if (backWood != otherSpec.getBackWood())
return false;
if (topWood != otherSpec.getTopWood())
return false;
return true;
}

Anonymous 
Printed Page 49
If your target audience is only college level and up it may not be an issue for you). The use of the word "ass" on pages xxxiii and 49 would make me hesitate recommending the book to anyone teaching programming in high school classes.

Anonymous 
Printed Page 51
The clues for the crossword puzzle are blurry. It doesn't look like a printing issue to me but the choice of font.

Anonymous 
Printed Page 80
Second comment to the right, next to point 3

"(...) since them pushing the button isn't something that's you have to handle"

should probably be:

"(...) since them pushing the button isn't something that you have to handle"

Anonymous 
Printed Page 82
2/3 of the way down

If I am reading the code on page 82 correctly, the whole example of automatically closing the door is based on the assumption that in normal circumstances (the "main path"), a dog can go outside, do its business, and get back inside within FIVE SECONDS. The note on page 83 says that is "plenty of time to get back inside before the door closes." That is one fast dog!

I kept expecting this to be pointed out as a bug and fixed, but as of the end of chapter 3, it's not. In fact, the code is repeated on page 139.

Anonymous 
Printed Page 88
Code Magnets, 2d paragraph

"(...) there is a twist... all the magents for periods"

should be:

"(...) there is a twist... all the magnets for periods"

Anonymous 
Printed Page 88-90
N/A

On page 89, we see the first line of output from DogDoorSimulator.java is:

"Fido barks to go outside..."

Yet this option is missing from the code magnets on page 88, and the magnet is missing from the first line of the solution on page 90.

There is nowhere else this output could have come from; page 83 re-affirms this output should have come from the DogDoorSimulator class.

Aaron Adams 
Printed Page 107
Crossword hint, 21 across


Hint for 21 across starts "Use cases are easeist ...". Should be "easiest".

Anonymous 
Printed Page 128
(answers: how many scenarios in the use case "Todd and Gina's...")

path 1 and path 6 are identical. The correct answer should thus be that there are six different scenarios, not seven.

We can double-check this since you have two independent choices on the use case, the first of which has two different option (Fido let out by bark recognizer, Fido let out by Todd/Gina), and the second which have three options (Fido not stuck outside, Fido stuck and let in by bark recognizer, Fido stuck and let in by Todd/Gina). two times three equals, again, six scenarios, not seven.

Anonymous 
Printed Page 183
lower left

Note says "... it's the SAME class diagram."

Actually, it's not because it does not include BarkRecognizer.

The same thing can be said for the note on page 185.

Anonymous 
Printed Page 193
All

The output does not match DogDoorSimulator.java.
Example:
"Bitsie" vs. "A small dog"

Anonymous 
Printed Page 196
bottom exercise solution

The arrow from Attribute should point at "Equivalent to a member variable in a class." and the arrow from Operation should point to "This is the UML term that usually represents a method in one of your classes."

Anonymous 
Printed Page 199
In the class diagram

In the class diagram shown, class Inventory is associated to class Guitar and holding a reference to the Guitar class. The reference is named "inventory" in the class diagram by mistake (I suppose). It should have been named "guitar"

The same error is there in the very next page..

And on page no 205, class Inventory is holding a reference named "inventory" to abstract class "Instrument". The reference must have been named "instrument"

Yes you allow for re-opening the door if Fido is stuck outside, but it's confusing to see that described as the "alternate path" (when something goes wrong) since it would pretty much always be used.

Anonymous 
Printed Page 199
on the Guitar Class

on the Guitar Class 'inventory *' -> 'guitars *'

Anonymous 
Printed Page 205
1st paragraph

"Whenever you find common behavior in two or more places, look to abstract that behavior into a class, and then reuse that behavior in the common classes"

The last two words should be "common class" (singular instead of plural).

Anonymous 
Printed Page 212
Last method - search()

The line

Mandolin mandolin = (Mandolin)i.next();

in

public List search(MandolinSpec searchSpec)

will fail at runtime if the Instrument returned by next() is of type Guitar. A instanceof check is required before the casting is done (in both search methods - the Mandolin search as well as Guitar search)

Anonymous 
Printed Page 344
First full paragraph, starts with "Below is ..."


The last sentence of the paragraph appears to be cut off. There is no period, and the sentence doesn't end normally -- "... and units being both added to and removed from"

Anonymous 
Printed Page 389
First comment to the left

The first comment to the left reads:

"#6 and #9 (...), but the basic functinality (...)"

It should be:

"#6 and #9 (...), but the basic functionality (...)"

Anonymous 
Printed Page 400
Top Title

I have an early print of this book but didn't see this mentioned as being changed in the most recent printing.
The title at the top "Contestant #4" I believe should read "Principle #4." If you look at page 390 you will see "Principle #3" on page 382 you will see "Principle #2" and on page 377 you will see "Principle #1."

No where else in this chapter does it mention Contestant #1-3.

Anonymous 
Printed Page 476
last method in UnitGroup

A call to getUnits() is going to die at runtime with a ClassCastException--the objects in the iterator aren't Units, they're Map.Entrys.

How about:
public List getUnits() {
List unitList = new LinkedList();
for (Iterator i = units.entrySet().iterator(); i.hasNext(); ) {
Unit unit = (Unit) ((Map.Entry) i.next()).getValue();
unitList.add(unit);
}
return unitList;
}

Or (less hideously) iterate over values() and use new-style for syntax:
public List getUnits() {
List unitList = new LinkedList();
for (Unit i: units.values()) {
unitList.add(i);
}
return unitList;
}

Or simply rely on the fact that values() gives us a Collection and we can construct a LinkedList directly from a Collection:
public List getUnits() {
return new LinkedList(units.values());
}

Anonymous 


"There are solid guidelines within the book which portray OOA as flexible in the real world - in a way which is much more readable than many OOA&D texts out there. For those unfamiliar with Head First Labs, this would be a novelty - for those familiar with Head First Labs, this is expected."
--Taran Rampersad, KnowProse.com