Welcome to the Core Java Bug List

How to Tell which Printing You Have

On the bottom of the copyright page (facing the first page of the table of contents), look for a line such as “First printing, December 2012”. In the errata below, we indicate the printing in which the error has been fixed inside square brackets such as [4].

For example, suppose you have the fourth printing. Then you can ignore all reports that are prefixed with [2], [3] or [4]. But you would want to pay attention to all reports that are prefixed with [5] or higher or that have no bracketed prefix at all.

9th Edition Volume 1 (Java SE 7)

Page 23
Change jar xvf jdk-version-apidocs.zip to jar xvf jdk-version-docs-all.zip
[2] Page 51

Change "For example, the mathematical symbol for the set of integers ℤ has code point U+1D56B and is encoded by the two code units U+D835 and U+DD6B." to “For example, the mathematical symbol for the set of octonions 𝕆 (http://math.ucr.edu/home/baez/octonions) has code point U+1D546 and is encoded by the two code units U+D835 and U+DD46.”

(Why the change? When I first wrote that section, way back when in 2004, I mistook 𝕫 (U+1D56B), which is in Mathematical Letterlike Symbols, for an uppercase ℤ, which is actually U+2124 in Letterlike Symbols, as are the other more common sets ℕ ℚ ℝ ℂ and even ℍ. Apparently, so few readers care about supplementary characters that it took eight years for the error to be noticed.)

If the characters in the preceding paragraphs show up as gibberish, make sure your browser displays UTF-8.

[2] Page 61
Add a solid arrow from float to double in Figure 3.1
[2] Page 68
Change the second 3.6.5 to 3.6.6, and increment the section numbers on pages 69, 72, 74 and the references on pages 66 and 70.
[2] Page 69
ℤ is the set of integers


𝕆 is the set of octonions

Change “The character ℤ” to “The character 𝕆 (U+1D546)”

Page 70
Change “returns the code point that starts or ends at the specified location.” to “returns the code point that starts at the specified location”.
[2] Page 71
In the documentation of trim, change “all leading and trailing spaces” to “all leading and trailing white space”
Page 80
In Table 3.5, change “tx” to “tx or Tx”. Change “Date and time” to “Date and time (T forces uppercase)”
Page 85
Change “various ways of handing exceptions” to “various ways of handling exceptions”
Page 83
Change the two rows
P Uppercase morning or afternoon marker PM
p Lowercase morning or afternoon marker pm
to a single row
p Morning or afternoon marker pm
[2] Page 85
Change “a “file not found” exception” to “an “input/output” exception” and throws FileNotFoundException to throws IOException
Page 101
Remove “(or their corresponding wrapper classes Character, Byte, Short, and Integer that will be introduced in Chapter 4)”
Page 101
Change “We will discuss annotations in detail in Chapter 13 of Volume II.” to “We will discuss annotations in detail in Chapter 10 of Volume II.”
Page 109
Change “and the Iterable interface in Chapter 2 of Volume II” to “and the Iterable interface in Chapter 13”
[2] Page 115
The second copyOf method in the API doc should instead be copyOfRange.
[2] Page 134
In figure 4.4, change the second birthday to deadline
[2] Page 140
In the last line, remove the space between String and []
[2] Page 141
In the first sentence, change “returns a string” to ”returns an array of strings”
[2] Page 152
The second this in the second raiseSalary should be in boldface to match the two bold number007 above.
Page 155
Change return hireDay.clone(); to return (Date) hireDay.clone();
Page 160
Change “Since static methods don’t operate on objects, you cannot access instance fields from a static method. However, static methods can access the static fields in their class.” to “A static method of the Employee class cannot access the id instance field because it does not operate on an object. However, a static method can access a static field.” (A reader complained that the original statement is false since a static method can manipulate instance fields of other objects of the same class. For example, you can have a public static int compare(Employee a, Employee b).)
Page 160
In the Note, change Employee.getnextId() to Employee.getNextId()
Page 172
Change “or if more than one match is possible.” to “, either because there is no match at all or because there there is not one that is better than all others.”
[2] Page 178
Change “You can write a “Hello, World” program” to “Up to JDK 6, you can write a “Hello, World” program”
Page 180
Change --see below to --see above in source line 68
Page 200, 201
Items 6, 7 should be numbered 5, 6
[2] Page 217
In the Caution note, change “a weaker access privilege” to “a more restrictive access privilege”
Page 229
In the last line, change Object.equals to Objects.equals
[2] Page 236
In the second API note, change int hash(Object... objects) to static int hash(Object... objects)
Page 236
Change java.lang.Objects to java.util.Objects
[2] Page 243
Change “in particular in C” to “in particular in C++”
Page 287
Change “weaker access privilege” to “more restrictive access privilege”
[2] Page 288
In the last line of the Tip, change x > 0 to x > y
Page 289
Remove "for sorting an employee array."
Page 291
Change “java.lang.Integer 7” to “java.lang.Integer 1.0” and add 7 after static int compare(int x, int y). Change “java.lang.Double 7” to “java.lang.Double 1.0” and add 1.4 after static int compare(double x, double y)
Page 315
Change “complier” to “compiler”
[2] Page 321
In the Note, change favorites to friends (2x)
[2] Page 342
Remove / / / /
[2] Page 344
Remove the / at the beginning of two paragraphs
[2] Page 348
Remove the / before boolean isVisible()
Page 372
Rectangle2D bounds = f.getStringBounds(message, context);
Rectangle2D bounds = sansbold14.getStringBounds(message, context);
Page 461
Under the createBevelBorder method, change “EtchedBorder.RAISED, EtchedBorder.LOWERED” to “BevelBorder.RAISED, BevelBorder.LOWERED
[2] Page 645
After try Scanner in = new Scanner(new FileInputStream("/usr/share/dict/words")), change the comma to a semicolon
Page 646
ByteArrayOutputStream out = new ByteArrayOutputStream();
String description = out.toString();
StringWriter out = new StringWriter();
t.printStackTrace(new PrintWriter(out));
String description = out.toString();
Page 679
java MyProgram >& errors.txt
java MyProgram 1> errors.txt 2>&1
Page 708
Change class Interval<Serializable & Comparable> to class Interval<T extends Serializable & Comparable>
Page 765
Change “and finally prints out all words in the set” to “and finally prints out the first twenty words in the set”
Page 767
Change System.println to System.out.println
Page 778
Change Collection<K> values() to Collection<V> values()
Page 778
Change “the static inner class Map.Entry” to “a class implementing the Map.Entry interface”
Page 796
Change “get and put are serialized” to “get and put are synchronized”
Page 833
Change “There is a way to force a thread” to “There is no way to force a thread”
[2] Page 901
Change “periodially” to “periodically”
Page 902
Change java.util.concurrent.ExecutorCompletionService to java.util.concurrent.ExecutorCompletionService<V> and change all T to V in the box below
Page 902
In the second line from the bottom, remove “Fork-join framework”
Page 904
Change “Listing 14.13. forkJoin/forkJoinTest.java” to “Listing 14.13. forkJoin/ForkJoinTest.java ”
Page 925
Change “he 8-bit integer type” to “the 8-bit integer type”

9th Edition Volume 2 (Java SE 7) ???

Page xvii
Switch the descriptions for chapters 10 and 11
Page 16
BufferedReader in = new BufferedReader(
   new InputStreamReader(new FileInputStream("employee.txt"), "UTF-8));
BufferedReader in = new BufferedReader(
   new InputStreamReader(new FileInputStream("employee.txt"), "UTF-8"));
[2] Page 58
Change “when resolved with q” to “when resolved with p
[2] Page 58
Change "../fred/myapp" to "../fred/myprog"
[2] Page 64
Change files.readAttributes to Files.readAttributes (2x)
Page 66
public FileVisitResult visitFile(Path path, BasicFileAttributes attrs) throws IOException
   if (attrs.isDirectory())
   return FileVisitResult.CONTINUE;
public FileVisitResult preVisitDirectory(Path path, BasicFileAttributes attrs) throws IOException
   return FileVisitResult.CONTINUE;
[2] Page 66
Change "Escapes any of the above" to "Escapes any of the above as well as \"
Page 67
In the API notes for java.nio.file.Files, all the methods should be marked as static.
[2] Page 82
Change "To include a [, make it the first item." to "To include a ], make it the first item."
Page 201
Change while (in.hasNextLine() != null) to while (in.hasNextLine())
Page 271
Change “gets the characters in the given range from this BLOB.” to “gets the characters in the given range from this CLOB.”
Page 324
Change currentDateFormat.setLenient to currentTimeFormat.setLenient
Page 367
Object[] selection = source.getSelectedValues();
List<String> selection = source.getSelectValuesList();
Page 370
Change getSelectedValues() to getSelectedValuesList()
[2] Page 383
Change “The resulting table...out of view!” to “When you scroll the table, the table header doesn't scroll out of view.”
[2] Page 384
Below the Note, add a Caution item: If you don’t wrap a table into a scroll pane, you need to explicitly add the header:
add(table.getTableHeader(), BorderLayout.NORTH);      
[2] Page 389
In line 39 of the source code, change add(table); to add(new JScrollPane(table));
Page 396
Change “If a TableStringConverter has been set for the comparator” to “If a TableStringConverter has been set for the sorter”, and change orter.setStringConverter to sorter.setStringConverter
Page 406
Change javax.swing.table.TableStringConverter<M extends TableModel> to javax.swing.table.TableStringConverter
Page 420
Set javax.swing.table.TableCellEditor in italic
Page 431, 461, 462
Set javax.swing.tree.TreeModel in italic
Page 603
Rendering-Hints should be RenderingHints
Page 628
Change float 20.0f; to float b = 20.0f;
Page 896
Change engine.put(b, ...) to engine.put("b", ...)
Page 897
Change scope.put(b, ...) to scope.put("b", ...)
Page 921
Change “ The annotation, defined in Listing 10.9, is used as follows:” to “ The annotation, defined in Listing 10.11, is used as follows:”
Page 926
int severity() = 0; 
int severity() default 0; 

Thanks to Yasir Bajwa, Patrick Brinich-Langlois, Joe Cassara, Neal Crawford, Russell Dauterman, Chen Dong, Peter Drake, Mehmet Erten, Adrian Fabian, Ken Frazer, Kirk Goff, Paul Grabow, Micha Guzek, Pedro Juan Hidalgo, Jan Huysmans, Manuel Irribarra, Andrew Janke, Harri Jauri, Xiaoyu Jiang, Reza Khedmati, Vadim Kramer, Bo Li, Mike McMenemy, Stevens R. Miller, Julie Nahil, Dennis Oleksyuk, Ivonne Roberts, Peg Russell, Anubhav Saggi, Anton Suprunyuk, Grzegorz Szpetkowski, Arzu Tarimci, Sergey Travin, Yuriy Trubitsyn, Sergey Vaysman, Shawn Wallis, Christopher Whidden, Christian Wilkie, Jim Woodruff, Scott Wright, Garrett Xu, Leo Zhang, and (your name might go here) for their bug reports!

Please report any remaining bugs in this edition on the bug report form.