Java 1.5 Tiger: A Developer's Notebook by David Flanagan, Brett McLaughlin This errata page lists errors outstanding in the most recent printing. If you have technical questions or error reports, you can send them to booktech@oreilly.com. Please specify the printing date of your copy. This page was updated February 27, 2006. Here's a key to the markup: [page-number]: serious technical mistake {page-number}: minor technical mistake : important language/formatting problem (page-number): language change or minor formatting problem ?page-number?: reader question or request for clarification Confirmed errors: {2} Example 1-1 //fill up somes values; Arrays.fill(myOtherArray, ... must be read as Arrays.fill(myArray, ... (4) 3rd paragraph; "...write your own recursion printing routines." should be "...write your own recursive printing routines." {5} Paragraph starting "Another cool collection"; Change "java.util.Queue class" to "java.util.Queue interface" {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"); (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. (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." (16) First note in the margin; Remove the first note in the margin says "Generics don't apply to primitive types". (35) 3rd sentence of the introduction; Change "neither is these is" to "neither of these is" (39) 2nd line; Change "oridinal()" to "ordinal()" (40) second piece of code; Change: student1.assignGrade(OldClass.EnglishList); to: student1.assignGrade(OldClass.EnglishLit); (40) 1st sentence of "Declaring Enums Inline"; Change "its also" to "it's also" (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 antMessages = EnumMap(AntStatus.class); Should be: EnumMap antMessages = new EnumMap(AntStatus.class); [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 } {49} 3rd snippet of code; Change: ... OldGuitarFeatures.IL_DIAMONDS) != 0; to: ... OldGuitarFeatures.AB_ROSETTE) != 0; (50) 1st snippet of code; Change: //Varags version to: //Varargs version (50) 1st snippet of code; Change: EnumSet allFeatures = EnumSet.allOf(GuitarFeatures); to: EnumSet allFeatures = EnumSet.allOf(GuitarFeatures.class); (51) 1st line; Change "complentOf() is also a handy method" to "complementOf() is also a handy method" {52} Example 3-7, under "getUpcharge()" method.; There is an extra closing bracket } under the "getUpcharge()" method (57) the first line of the first snippet of code; Change "the the" to "the three". (59) the last line; The last sentence ends in two full stops (periods). So change "able to find.." to "able to find." {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". (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 ... (80) 1st paragraph, 1st line; WRONG: "... see its a..." RIGHT: "... see it's a..." (80) 3rd and 5th code snippets; Change: out.printf("Description of object array: %s\n", obj); to: out.printf("Description of object array: %s\n", objectArray); (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,... (81) 4th line; out.printf("Description of object array: %s\n", new Object[] { obj }); should be: out.printf("Description of object array: %s\n", new Object[] { objectArray }); (81) 6th line; out.printf("Description of object array: %s\n", (Object)obj); should be: out.printf("Description of object array: %s\n", (Object)objectArray); (82) 1st paragraph, 3rd sentence; WRONG: "... for a compiler, and JavadocJavadoc, which..." RIGHT: "... for a compiler, and Javadoc, which... [92] Example 6-6; Line 3 reads: Severity severity() default Severity.IMPORTANT; Should be: Severity severity(); as defaults are introduced in Example 6-7. [106] TIP; The explanation in the TIP is obsolete. Remove the Tip. (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 + " "); } (117) Example 7-6; The constructor assigns a new GuitarManufacturerList() 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 . By leaving off the parameter, it works fine. (119) 1st paragraph; "TextFileIterator" use 2 different fonts (119) CustomObjectTester constructor; GuitarManufacturerList is not a generic type, hence is wrong. The sample code available for download is correct, though. (130) 1st paragraph. 1st sentence.; WRONG: "Now, add you can create..." RIGHT: "Now, you can create..." {136} Table 9-2; Formatting %tr should be "The hour, minute, second and morning or afternoon indicator on a 12-hour clock" {136} first row in the table; %tE should be %tQ - the %tE generates an exception (136) last row of table 9-2; the conversion symbol of last item should be %tz, all lowercase [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:" (153) 1st note; ...should want for locks... should be: ...should wait for locks... (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. {158} Last sentence of "Using Callable Objects"; ...the new java.util.concurrent.Callable class. should be: ...the new java.util.concurrent.Callable interface. (163) 4th line of 1st paragraph; a left brace without right one (164) 1st line, 1st paragraph; typo: syncrhonized [Back Cover] Bottom right.; "Web at ww.oreilly.com" Should be: "Web at www.oreilly.com"