Welcome to the Core Java Bug List

8th Edition Volume 1 (Java SE 6)

8th Edition Volume 2 (Java SE 6)

7th Edition Volume 1 (Java SE 5.0)

7th Edition Volume 2 (Java SE 5.0)

6th Edition Volume 1 (Java SE 1.4)

There was no 6th Edition Volume 2

5th Edition Volume 1 (Java SE 1.3)

5th Edition Volume 2 (Java SE 1.3/1.4)

4th Edition Volume 1 (Java SE 1.2)

4th Edition Volume 2 (Java SE 1.2)

3rd Edition (JDK 1.1)

2nd Edition (JDK 1.02)

1st Edition (JDK 1.0)

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, April 2008

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.

8th Edition Volume 1 (Java SE 6)

Page 11 [2]
In Table 1-1, change the year for Version 1.4 from 2004 to 2002
Page 51 Figure 3-1 [2]
Add an arrow from float to double
Page 69 [2]
Change “the decimal separator is a period, not a comma” to “the group separator is a period not a comma”
Page 70 [2]
Change "If the file does not exist, you can simply" to "If the file does not exist, it is created. You can simply"
Page 90 [2]
Change "This statement sets up an array that can hold 100 integers." to "This statement creates an array of 100 integers. When you create an array of numbers, all elements are initialized with 0. (Arrays of boolean are initialized with false, arrays of objects with null values.)"
Page 91, 93, 100 [2]
Change "entries" to "elements" (5x)
Page 93 [2]
Change “the copyTo method” to “the copyOf method”
Page 93 Figure 3-14 [2]
Change 12 to 13
Page 103 [2]
Change "entry" to "element" (2x)
Page 107 [2]
Change “Thinking about classes as cookie cutters.” to “Think about classes as cookie cutters.”
Page 113 Figure 4-4 [2]
Change the second birthday to deadline
Page 113 [2]
Change "Variables are not automatically initialized to null." to "Local variables are not automatically initialized to null."
Page 161 [2]
Change MyProg.java to MyProg (2x)
Pages 181, 185, 218 [2]
Change “runtimeruntime” to “runtime”
Page 192 [2]
Change “see Volume II for more on threads” to “see Chapter 14 for more on threads”
Page 197 [2]
Change “Chapter 2 of Volume II.” to “Chapter 13.”
Page 252 [2]
Add a semicolon after
cloned.hireDay = (Date) hireDay.clone()
Page 258 [2]
Change javax.awt.Toolkit to java.awt.Toolkit
Page 286 SimpleFrameTest.java [2]
Replace lines 11-13 with
         EventQueue.invokeLater(new Runnable()
         {
            public void run()
            {
               SimpleFrame frame = new SimpleFrame();
               frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
               frame.setVisible(true);
            }
         });

Then add a line at the top of the file

import java.awt.*;
Page 290 [2]
Change
setLoationByPlatform(true);

to

setLocationByPlatform(true);
Page 298 NotHelloWorld.java [2]
Change lines 36 and 37 to
      NotHelloWorldComponent comp = new NotHelloWorldComponent();
      add(comp);

In line 45, change “panel” to “component”

Change line 47 to

class NotHelloWorldComponent extends JComponent
Page 344 [2]
Change “you nee to know” to “you need to know”
Page 352
Add a } below repaint(); that lines up with the { below the if.
Page 365 [2]
In Figure 9-3, change WYSIWG to WYSIWYG
Page 392 [2]
Add a semicolon after Border etched = BorderFactory.createEtchedBorder()
Page 401 [2]
Change "See Chapter 2 of Volume II" to "See Chapter 13"
Page 506 [2]
Change “when it was signed it” to “when it was signed”
Page 535 [2]
Change
appletviewer NotHelloAppletApplication.java
java NotHelloAppletApplication

to

appletviewer AppletApplication.java
java AppletApplication
Page 569 [2]
Change try() to try
Page 610 [2]
Change setColor(Color.yellow) to setBackground(Color.yellow)
Page 614 [2]
Change
String filename = (String) names.get(0);

to

String filename = (String) files.get(0);
Page 618 [2]
Change “wrong,and” to “wrong, and“
Page 636 [2]
Change “you can call the setObject method” to “you can call the setFirst method”
Page 636 [2]
Change “tests whether a pair contains a given object.” to “tests whether a pair contains a null reference.”
Page 637 [2]
Change
PairAlg.swapHelper(result);

to

PairAlg.swap(result);
Page 660 [2]
Change “and and then removes” to “and then removes”
Page 671 SetTest.java [2]
Change line 26 to
      for (int i = 1; i <= 20 && iter.hasNext(); i++)
Page 684 [2]
Change
V get(K key)

to

V get(Object key)
Page 717 [2]

Change "the panel is never repainted because the addBall method has completely taken over all processing." to "the panel is only repainted after the addBall method has returned."

Page 730 [2]
Change Thread().currentThread().interrupt() to Thread.currentThread().interrupt()
Page 751 [2]
Change “you should you should” to “you should”
Page 760 [2]
Change “Transfer $997 to from Account 1” to “Transfer $997 from Account 1”

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

Page 7 [3]
In figure 1-3, the arrow from CharBuffer to Reader should instead point to the Readable interface.
Page 83 [3]
Change HrefMatch.java Line 33
"<a\\s+href\\s*=\\s*(\"[^\"]*\"|[^\\s>])\\s*>"

to

"<a\\s+href\\s*=\\s*(\"[^\"]*\"|[^\\s>]*)\\s*>"
Page 529 [3]
Change
skewedAngle = Math.toDegrees(Math.atan2(x * width, y * height));

to

skewedAngle = Math.toDegrees(Math.atan2(-y * height, x * width));

Thanks to Yasir Bajwa, Chad Bamford, Fred Brasch, Lynn Robert Carter, Mark Chamberlin, Joseph Collins, Chris Colvard, Matthew Dempsky, Greg Drysdale, Douglas Eddy, Louis Fuka, Angelo Furfaro, Siegmar Gross, Richard Hall, David Hinkle, George Kollias, Ashok Kumar, David Lanznar, Larry LaPointe, James Lee, David Lyng, Jeremy Palmer, Diego Pérez, Łukasz Piwko, Boaz Porat, Philip Puryear, Dave Richards, Ken Rocha, Vickram Sawh, Zheng Song, Raj Subramanian, Viktor Toman, R. Wahl, Andrew Wan, Steven Zollo, Keoki Zee, and (your name might go here) for their bug reports!


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. Please do not bug us with JDK problems, though. Unfortunately, we cannot reply personally to each report, but we 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.