Errata

Java 5.0 Tiger: A Developer's Notebook

Errata for Java 5.0 Tiger: A Developer's Notebook

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 "Date 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 Note Update

Version Location Description Submitted By Date submitted Date corrected
Printed
Page Back Cover
Bottom right.

"Web at ww.oreilly.com"
Should be:
"Web at www.oreilly.com"

Anonymous   
Printed
Page 2
Example 1-1 //fill up somes values

Arrays.fill(myOtherArray, ...
must be read as
Arrays.fill(myArray, ...

Anonymous   
Printed
Page 4
3rd paragraph

"...write your own recursion printing routines." should be "...write your own recursive printing routines."

Anonymous   
Printed
Page 5
Paragraph starting "Another cool collection"

Change "java.util.Queue class" to "java.util.Queue interface"

Anonymous   
Printed
Page 6
the code

public void testFIFO(PrintStream out) throws IOException {
q.add('First");
q.add("Second");
q.add("Third);

Should be:

public void testFIFO(PrintStream out) throws IOException {
q.offer("First");
q.offer("Second");
q.offer("Third");

Anonymous   
Printed
Page 11
Last sentence

"So if you're needing values in Unicode 3.0 that..."
Should be:
"So if you're needing values in Unicode 4.0 that..."

Also, there are also two periods at the end of this sentence, remove one.

Anonymous   
Printed
Page 12
5th paragraph, last sentence

The text reads
"Of course, only the lowest 21 bits are used, as that's all that is needed; the upper 21 bits are zeroed out."
the end of the text should read

" the upper 11 bits are zeroed out."

Anonymous   
Printed
Page 16
First note in the margin

Remove the first note in the margin says "Generics don't apply to primitive types".

Anonymous   
Printed
Page 35
3rd sentence of the introduction

Change "neither is these is" to "neither of these is"

Anonymous   
Printed
Page 39
2nd line

Change "oridinal()" to "ordinal()"

Anonymous   
Printed
Page 40
second piece of code

Change:
student1.assignGrade(OldClass.EnglishList);
to:
student1.assignGrade(OldClass.EnglishLit);

Anonymous   
Printed
Page 40
1st sentence of "Declaring Enums Inline"

Change "its also" to "it's also"

Anonymous   
Printed
Page 41
How do I do that?

public void listGradeValues(PrintStream out) throws IOException {
Grade[] gradeValues = Grade.values();
for ( Grade g : Grade.values() ) {
out.println("Allowed value: '" + g + "'");
}
}

Should be::

public void listGradeValues(PrintStream out) throws IOException {
Grade[] gradeValues = Grade.values();
for (int i=0; i<gradeValues.length; i++) {
out.println("Allowed value: '" + gradeValues[i] + "'");
}
}

Anonymous   
Printed
Page 42
the code in the "What about..." section

The line:
for (Grade g : grade.values()) {
should be changed to:
for (Grade g : Grade.values()) {

Anonymous   
Printed
Page 42
1st sentence of "How do I do that?"

Change "Prior to Java 1.4" to "Prior to Tiger"

Anonymous   
Printed
Page 43
1st real sentence on the page

Change
"The argument to switch must be an enumerated value"
to
"The argument to switch can be an enumerated value"

Anonymous   
Printed
Page 47
the code just above the "TIP"

EnumMap<AntStatus, String> antMessages =
EnumMap<AntStatus, String>(AntStatus.class);

Should be:

EnumMap<AntStatus, String> antMessages =
new EnumMap<AntStatus, String>(AntStatus.class);

Anonymous   
Printed
Page 49
Examples 3-5 code

Here's what the code listing should read instead of what it reads now:

package com.oreilly.tiger.ch03;

public class OldGuitarFeatures {

public static final int ROSEWOOD = 0x01; // back/sides
public static final int MAHOGANY = 0x02; // back/sides
public static final int ZIRICOTE = 0x04; // back/sides

public static final int SPRUCE = 0x08; // top
public static final int CEDAR = 0x10; // top

public static final int AB_ROSETTE = 0x20; // abalone rosette
public static final int AB_TOP_BORDER = 0x40; // abalone top border

public static final int IL_DIAMONDS = 0x80; // diamond/square inlay
public static final int IL_DOTS = 0x100;// dots inlays

}

Anonymous   
Printed
Page 49
3rd snippet of code

Change:
... OldGuitarFeatures.IL_DIAMONDS) != 0;
to:
... OldGuitarFeatures.AB_ROSETTE) != 0;

Anonymous   
Printed
Page 50
1st snippet of code

Change:
//Varags version
to:
//Varargs version

Anonymous   
Printed
Page 50
1st snippet of code

Change:
EnumSet allFeatures = EnumSet.allOf(GuitarFeatures);
to:
EnumSet allFeatures = EnumSet.allOf(GuitarFeatures.class);

Anonymous   
Printed
Page 51
1st line

Change
"complentOf() is also a handy method"
to
"complementOf() is also a handy method"

Anonymous   
Printed
Page 52
Example 3-7, under "getUpcharge()" method.

There is an extra closing bracket } under the "getUpcharge()" method

Anonymous   
Printed
Page 57
the first line of the first snippet of code

Change "the the" to "the three".

Anonymous   
Printed
Page 59
the last line

The last sentence ends in two full stops (periods). So change "able to find.." to
"able to find."

Anonymous   
Printed
Page 67
4th paragraph, starting with "Another statement that..."

The last sentence reads: "With unboxing in play, you can now supply it with Integer,
Short, Char, and Byte values as well, in addition to the introduction of enums."

There is no such class as "Char". It should read "Character".

Anonymous   
Printed
Page 79
2nd paragraph

Paragraph reads:
The problem here is that now this method won't take Strings, ints ....
Should read
The problem here is that now this method won't take ints ...

Anonymous   
Printed
Page 80
1st paragraph, 1st line

WRONG: "... see its a..."
RIGHT: "... see it's a..."

Anonymous   
Printed
Page 80
3rd and 5th code snippets

Change:
out.printf("Description of object array: %s
", obj);
to:
out.printf("Description of object array: %s
", objectArray);

Anonymous   
Printed
Page 81
first line

...you want the entire object array, obj, treated as a single object,...
should be:
...you want the entire object array, objectArray, treated as a single object,...

Anonymous   
Printed
Page 81
4th line

out.printf("Description of object array: %s
", new Object[] { obj });
should be:
out.printf("Description of object array: %s
", new Object[] { objectArray });

Anonymous   
Printed
Page 81
6th line

out.printf("Description of object array: %s
", (Object)obj);
should be:
out.printf("Description of object array: %s
", (Object)objectArray);

Anonymous   
Printed
Page 82
1st paragraph, 3rd sentence

WRONG: "... for a compiler, and JavadocJavadoc, which..."
RIGHT: "... for a compiler, and Javadoc, which...

Anonymous   
Printed
Page 92
Example 6-6

Line 3 reads:
Severity severity() default Severity.IMPORTANT;
Should be:
Severity severity();

as defaults are introduced in Example 6-7.

Anonymous   
Printed
Page 106
TIP

The explanation in the TIP is obsolete.
Remove the Tip.

Anonymous   
Printed
Page 112
Example 7-1.

for(Object word : wordList) {
System.out.print((String)word + " ");
}

does not need the type cast. It should be:

for(Object word : wordList) {
System.out.print(word + " ");
}

Anonymous   
Printed
Page 117
Example 7-6

The constructor assigns a new GuitarManufacturerList<String>() to the private field,
but my compiler (Eclipse with Sun JDK 1.5_03) reports "The type
GuitarManufacturerList is not generic; it cannot be parameterized with arguments
<String>.

By leaving off the parameter, it works fine.

Anonymous   
Printed
Page 119
1st paragraph

"TextFileIterator" use 2 different fonts

Anonymous   
Printed
Page 119
CustomObjectTester constructor

GuitarManufacturerList is not a generic type, hence <String> is wrong.

The sample code available for download is correct, though.

Anonymous   
Printed
Page 130
1st paragraph. 1st sentence.

WRONG: "Now, add you can create..."
RIGHT: "Now, you can create..."

Anonymous   
Printed
Page 136
Table 9-2

Formatting %tr should be "The hour, minute, second and morning or afternoon indicator on a 12-hour clock"

Anonymous   
Printed
Page 136
first row in the table

%tE should be %tQ - the %tE generates an exception

Anonymous   
Printed
Page 136
last row of table 9-2

the conversion symbol of last item should be %tz, all lowercase

Anonymous   
Printed
Page 151
2nd paragraph, 2nd sentence

The text reads:

"What's cool, though, is that the processing cycles
through the four consumers, in order:"
It should say:
"What's cool, though, is that the processing cycles
through the four consumers:"

Anonymous   
Printed
Page 153
1st note

...should want for locks...
should be:
...should wait for locks...

Anonymous   
Printed
Page 155
paragraph starting "So what happens..."

The paragraph starting with "So what happens..." on page 155 is repeated.

Delete the first occurrence of the paragraph starting "So what happens..." on page 155
through the paragraph ending "... You'd do well to use one of these yourself." on
page 156.

The second occurrence of the paragrah is the entire section named "Executing Tasks Without an
ExecutorService" which spans page 160-161, and it is correct.

Anonymous   
Printed
Page 158
Last sentence of "Using Callable Objects"

...the new java.util.concurrent.Callable class.
should be:
...the new java.util.concurrent.Callable interface.

Anonymous   
Printed
Page 163
4th line of 1st paragraph

a left brace without right one

Anonymous   
Printed
Page 164
1st line, 1st paragraph

typo: syncrhonized

Anonymous