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 2015”. 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.

10th Edition Volume 1 (Java SE 8)

Page 51
In the Caution note, change \u00A0 to \u000A.
Page 74
Change “The API documentation is part of the JDK. It is in HTML format. Point your web browser to the docs/api/index.html subdirectory of your JDK installation (Figure 3.2).” to “You can download the API documentation from Oracle and save it locally, or you can point your browser to http://docs.oracle.com/javase/8/docs/api (Figure 3.2).”
Page 89
Change “Finally, there is a variant of the for loop that has no analog in C or C++. It is similar to the foreach loop in C#.” to “Finally, there is a variant of the for loop that is similar to the range-based for loop in C++ and the foreach loop in C#.”
Page 150
Change
LocalDate hireDay = LocalDate.of(year, month, day);
to
hireDay = LocalDate.of(year, month, day);
Page 173
Change
Employee(String name, double salary, int y, int m, int d)
to
public Employee(String n, double s, int year, int month, int day)
Page 178
Move step 3 before Step 1 in the numbered list, and change “the body of the second constructor is executed” to “the object is constructed with the second constructor before continuing with the body of this constructor”
Page 183
Change “For example, you can import all classes in the java.util package with the statement import java.util.*;” to “For example, you can import all classes in the java.time package with the statement import java.time.*;
Page 189
Change the section heading “Package Scope” to “Package Access”
Page 189
Change “package visibility” to “package access”
Page 230
Change Object.equals(hireDay, other.hireDay) to Objects.equals(hireDay, other.hireDay)
Page 243
Change
return super.hashCode() + 17 * new Double(bonus).hashCode();
to
return java.util.Objects.hash(super.hashCode(), bonus);
Page 251
Change void set(int index, E obj) to E set(int index, E obj) and “overwriting the previous contents” to “returning the previous contents.”
Page 258
Remove the semicolon after public enum Size { SMALL, MEDIUM, LARGE, EXTRA_LARGE }
Page 290
Change “package visibility” to “package access”
Page 292
Remove “for sorting an employee array”
Page 300
Change “Consider another interface with a getName method:” to “Consider two interfaces with a getName method:” and change the code below to:
interface Person
{
   default String getName() { return ""; };
}

interface Named
{
   default String getName() { return getClass().getName() + "_" + hashCode(); }
}
Page 323
Change “It is also illegal to refer to variable” to “It is also illegal to refer to a variable”.
Page 324
Change public class Application() to public class Application
Page 338
Change “Since the secret access methods have package visibility” to “Since the secret methods have package access”
Page 341
Remove the paragraph “As we already mentioned...always the same value” above the note.
Page 376
Change
try (Scanner in = new Scanner(new FileInputStream("/usr/share/dict/words"), "UTF-8")
to
try (Scanner in = new Scanner(new FileInputStream("/usr/share/dict/words"), "UTF-8"))
Page 378
Change
StackTraceTest.factorial(StackTraceTest.java:18)
StackTraceTest.main(StackTraceTest.java:34)
factorial(2):
StackTraceTest.factorial(StackTraceTest.java:18)
StackTraceTest.factorial(StackTraceTest.java:24)
StackTraceTest.main(StackTraceTest.java:34)
factorial(1):
StackTraceTest.factorial(StackTraceTest.java:18)
StackTraceTest.factorial(StackTraceTest.java:24)
StackTraceTest.factorial(StackTraceTest.java:24)
StackTraceTest.main(StackTraceTest.java:34)
to
stackTrace.StackTraceTest.factorial(StackTraceTest.java:20)
stackTrace.StackTraceTest.main(StackTraceTest.java:36)
factorial(2):
stackTrace.StackTraceTest.factorial(StackTraceTest.java:20)
stackTrace.StackTraceTest.factorial(StackTraceTest.java:26)
stackTrace.StackTraceTest.main(StackTraceTest.java:36)
factorial(1):
stackTrace.StackTraceTest.factorial(StackTraceTest.java:20)
stackTrace.StackTraceTest.factorial(StackTraceTest.java:26)
stackTrace.StackTraceTest.factorial(StackTraceTest.java:26)
stackTrace.StackTraceTest.main(StackTraceTest.java:36)
Page 393
Change “At least up to Java SE 7” to “Up to Java SE 7”.
Page 428
Change “Suppose the DateInterval method also overrides the getSecond method:” to “Suppose the DateInterval class also overrides the getSecond method:”
Page 428
Change
public void setSecond(Object second) { setSecond((Date) second); }
to
public void setSecond(Object second) { setSecond((LocalDate) second); }
and change
public LocalDate getSecond() { return (Date) super.getSecond().clone(); }
to
public LocalDate getSecond() { return (LocalDate) super.getSecond(); }
Page 432
Change
for (t : ts) coll.add(t);
to
for (T t : ts) coll.add(t);
Page 448
Change
PairAlg.swap(result); // OK--swapHelper captures wildcard type
to
PairAlg.swapHelper(result); // OK--swapHelper captures wildcard type
Page 467
Change return = true; to return true;
Page 468
Change boolean add(Object element) to boolean add(E element)
Page 489
Change System.println to System.out.println
Page 492
Change descripion to description in the toString method.
Page 493
Change E pollLast to E pollLast()
Page 496
Change @version 1.01 2012-01-26 to @version 1.02 2015-06-20
Page 497
Change int score = scores.get(id, 0); to int score = scores.getOrDefault(id, 0);
Page 498
Change @version 1.11 2012-01-26 to @version 1.12 2015-06-21
Page 501
Change “ if the key was previously absent” to “ if the key was previously absent (or mapped to null).”, and add the following to the API note:
Page 510
Change List group2 to List<Employee> group2
Page 513
Change “The methods such as get and put are serialized” to “The methods such as get and put are synchronized”
Page 523
Change Collections.replaceAll("C++", "Java"); to Collections.replaceAll(words, "C++", "Java");
Page 529
Change
Enumeration<Employee> e = staff.elements();
while (e.hasMoreElements())
{
   Employee e = e.nextElement();
   . . .
}
to
Enumeration<Employee> values = table.elements();
while (values.hasMoreElements())
{
   Employee e = values.nextElement();
. . .
}
Page 550
Add a bullet before “You can maximize a frame by calling”
Page 551
Change @version 1.33 2007-05-12 to @version 1.34 2015-06-16
Page 566
Change @version 1.33 2007-05-12 to @version 1.34 2015-06-16
Page 576
Change
Rectangle2D bounds = sansbold14..getStringBounds(message, context);
to
Rectangle2D bounds = sansbold14.getStringBounds(message, context);
Page 670
Change
faceCombo.getItemAt(faceCombo.setSelectedIndex()),
to
faceCombo.getItemAt(faceCombo.getSelectedIndex()),
Page 680
Change “When the user selects a menu” to “When the user selects a menu item”.
Page 686
Change
cutAction.putValue(Action.MNEMONIC_KEY, new Integer('A'));
to
aboutAction.putValue(Action.MNEMONIC_KEY, new Integer('A'));
Page 707
Change "The GBC helper class is in Listing 12.12" to "The GBC helper class is in Listing 12.11"
Page 889
Change “must have must have” to “must have”
Page 933
Change “wrapped in an unchecked ExecutionException” to “wrapped in an ExecutionException

10th Edition Volume 2 (Java SE 8) ???

(No bug reports yet)

Thanks to Aaron Chen, Alexey Elin, Yasir Bajwa, Maxim Belyaev, Zuo Cheng, Gianni Fabriziani, Pavlo Gotsonoga, Detlef Herm, Justin Jia, Paul Orekhov, Liutauras Vilda, Henry Ying, Mehran Zare, and (your name might go here) for their bug reports!

Bug Report Form

If you have found another bug in the book or in our code that is not mentioned in this bug list or the Core Java FAQ , then please send a report. Unfortunately, I cannot reply personally to each report, but I do read all your comments.

Your name:

Your email address:

Edition:
Page number:

Problem description:

To protect against spam robots, please answer this simple math problem:
* =


Back to the Core Java page.