OO Design & Patterns
2nd Edition
Bug Report Page

How to Tell which Printing You Have
On the copyright page (facing the first page of the Preface), there is a
printing history of the book. The printing history is a row of numbers that
-- at the first printing -- looks like this:
10 9 8 7 6 5 4 3 2 1
At each subsequent printing, one number is removed from the end of this
row of numbers to indicate which printing of the book you have. For example,
the last number in the row of numbers in the second printing is 2
10 9 8 7 6 5 4 3 2
In the third printing, the last number is 3, and so on.
In the errata below, we indicate the edition in which the error has
been fixed inside square brackets such as [3].
For example, suppose you have the third printing. Then you can
ignore all reports that are prefixed with [3] or [2]. But you would
want to pay attention to all reports that are prefixed with [4] or higher or
that have no bracketed prefix at all.
- [2]Page 83 Line 14 of MailSystem.java
- Change
mailboxes = new
ArrayList();
to
mailboxes = new
ArrayList<Mailbox>();
- [2]Page 86 Exercise 2.13
- Change tokenizer.next() to in.next().
- [2]Page 123
- Change "We will discuss postconditions in the next section." to "We
will discuss postconditions in section 3.6.4.".
- Page 136 Exercise 3.13
- Change the third row of the matrix from 0 0 b 1 to 0 0
b 0.
- [2]Page 154
- Change
helloButton.addActionListener(new ActionListener() {. .
.};);
to
helloButton.addActionListener(new ActionListener() {. .
.});
- [2]Page 171 Exercise 4.8
- Change "Test your class by filtering an array of strings" to "Test
your method by filtering an array of strings".
- [2]Page 172 Exercise 4.16
- Change
helloButton.addActionListener(
new
GreetingButtonListener("Hello,
World"));
goodbyeButton.addActionListener(
new
GreetingButtonListener("Goodbye, World"));
- to
helloButton.addActionListener(
new
GreetingButtonListener(textField, "Hello,
World"));
goodbyeButton.addActionListener(
new
GreetingButtonListener(textField, "Goodbye, World"));
- [2]Page 183
- Change "For example, the content pane of a frame is a container" to
"For example, a frame is a container". (Note: I know that a Swing
framedelegates to its content pane, but I think that is a technical
point whose explanation would obscure the fundamental concept .)
- [2]Page 186
- Change "We take advantage of the fact that the default content pane
of a frame has a border layout and add the three panels to the NORTH,
CENTER, and SOUTH areas of the content pane" to "We take advantage of
the fact that, by default, a frame has a border layout and add the
three panels to the NORTH, CENTER, and SOUTH areas". Change the caption
of Fig. 11 to "The Contents of the Telephone Frame"
- [2]Page 190
- Change "Simply set the layout manager of the content pane" to Simply
set the layout manager of the frame"
- [2]Page 193
- Change "But if we want to add it to the content pane" to "But if we
want to add it to the frame"
- [2]Page 196
- Change contentPane.add(scroller, BorderLayout.CENTER);
to frame.add(scroller, BorderLayout.CENTER);
- [2]Page 212
- Change // Add the text area and panel to the content pane to
// Add the text area and panel to the frame
- [2]Page 212 Exercise 5.5
- Change "by adding all components directly to the content pane" to "by
adding all components directly to the frame"
- Page 226 CarComponent.java
- Change "A component that shows a scene composed of items." to "A
component that shows a car."
- [2]Page 233
- Remove line 79
super.paintComponent(g);
- Page 242
- Change "public Attacker extends CompoundShape" to "public class
Attacker extends CompoundShape".
- [2]Page 259 Exercise 6.6.
- Change "Make the class of Exercise 6.5 implement the
java.awt.Shape interface type." to "Make the class of Exercise
6.5 implement the methods of the java.awt.Shape interface type
so that a LabeledRectangle can be drawn with the draw
method of the Graphics2D class."
- [2]Page 276
- Change
public class Manager
to
public class Manager extends Employee
- Page 294
- In the next to last line, change String get() to String
get(int i)
- [2]Page 295
- In the declaratation of public interface
Comparable<T>, and in the sentence following it, change
compare to compareTo.
- [2]Page 297
- Change
? extends E add(? extends E
newElement)
to
? extends E set(int i, ? extends E
newElement)
- [2]Page 297
- Change "If you call b.add(x)" to "If you call b.set(i,
x)".
- [2]Page 308
- Change "Next, add the button to the content pane" to "Next, add the
button to the frame"
- [2]Page 316 Exercise 7.3
- Change (j) Comparable[] to (j) Cloneable
- [2]Page 318 Exercise 7.26
- Change
public static <E, F . . .> void
putFirstLast(ArrayList<E> a, Pair<F> p)
to
public static <. . .> void putFirstLast(ArrayList<. .
.> a, Pair<. . .> p)
- [2]Page 318 Exercise 7.35
- Change "the color, dimension and draw mode properties" to "the color
and dimension properties".
- [2]Page 326
- Change
Iterator e =
iterator();
to
Iterator<E> e = iterator();
- [2]Page 331
- Change int indexOf(E obj) to int indexOf(Object
obj).
- [2]Page 370
- Change "We use the bounded queue of Chapter 8" to "We use a bounded
queue class that is similar to the one developed in Section 8.3.3."
- [2]Page 374
- In line 25 of BoundedQueue.java, change removeFirst to
remove.
- [2]Page 424 Exercise 10.3
- Change "InputStream" to "the Reader class".
Thanks to Marcello Dalpasso, Christopher Fuhrman, David Mayer, Evelyn
Obaid, Hao Pham and (your name could go here...) for their bug reports and
suggestions
Bug Report Form
Please use this form to report any bugs that you find. Please check the
list of known bugs and the list of frequently asked
questions first before you report a bug. Unfortunately, I do not have the
time to respond personally to every report, but I do read them all and will
post updates to this page. Thank you!