Errata


Print Print Icon

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 "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



Version Location Description Submitted By Corrected
Printed Page xiii
Under "Chapter 4, Functors" subheading, 2nd sentence

"...predicates, transformers, and closures, and functors,..."
^^^
should be:
"...predicates, transformers, closures, and functors,..."

Anonymous 
Printed Page 5

"import org.apache.commons.lang.builder.ToStringBuilder"
should be
"import org.apache.commons.lang.builder.ReflectionToStringBuilder"

Anonymous 
Printed Page 5
Error in toString() method

public void toString() {
ReflectionToStringBuilder.toString(this);
}

Should read:

public String toString() {
return ReflectionToStringBuilder.toString(this);
}

Anonymous 
Printed Page 6
Error in toString() method

public void toString() {
ReflectionToStringBuilder.toString( this );
}

Should be:

public String toString() {
return ReflectionToStringBuilder.toString( this );
}

Anonymous 
Printed Page 10

"PoliticalCandidate.class.isAssignableFrom(o)"
should read
"PoliticalCandidate.class.isAssignableFrom(o.getClass())"

Anonymous 
Printed Page 10
Variable misnamed in code example.

"PoliticalCandidate pc = (PoliticalCandidate) o;"
should be
"PoliticalCandidate ps = (PoliticalCandidate) o;"

Anonymous 
Printed Page 12

"public int compareTo(Object o) {"
should read
"public int compareTo(Object obj) {"

Anonymous 
Printed Page 25
code swatch at the center of page 25

Existing example:
// Rounding to the nearest hour
Date wokeUp = new Date();
Date wokeUpAround = DateUtils.round ( now, Calendar.HOUR );

Proposed change:
// Rounding to the nearest hour
Date wokeUp = new Date();
Date wokeUpAround = DateUtils.round ( wokeUp, Calendar.HOUR );

Anonymous 
Printed Page 28
1-16

private Flavor(String name, int value) { super( name, value ); }
should be:
private Flavor(String name) { super( name ); }

Anonymous 
Printed Page 47
Code sample should be completely replaced with the following

String variables = "{45}, {35}, {120}";
int sum = 0;

String[] tokens = StringUtils.split( variables, "," );
for( int i = 0; i < tokens.length; i++ ) {
String numberStr = StringUtils.substringBetween(tokens[i], "{", "}");
Integer number = new Integer( numberStr );
sum += number.intValue();
}

System.out.println( "Variables: " + variables + ", Sum: " + sum
);

Anonymous 
Printed Page 55
Code at top

The line
String name2Temp=StringUtils.replaceChars(name1,punctuation,"");
should be using name2 instead of name1.

Anonymous 
Printed Page 56
In code listing,

"countMatches(,"futility")"
should be
"countMatches(line,"futility")"

Anonymous 
Printed Page 61

The correct Levenshtein distance between "Steve" and "Stereo" is 2. The example output incorrectly lists this as 3.

Anonymous 
Printed Page 73
Last lines of top code, formatting error

"This example retrieves the name property of the author property on the Book
object, printing "Ralph Waldo Emerson""
should be a seperate paragraph of text.

Anonymous 
Printed Page 73
middle of page:

"General Exception is caught." should not be the first line of the code example and should be removed.

Anonymous 
Printed Page 78
Paragraph under figure

The getProperty() method parses the supplied property name,
splitting the name as the period character.
should be:
The getProperty() method parses the supplied property name,
splitting the name at the period character.

Anonymous 
Printed Page 86

Levenshtein distance between "Word" and "World" is one. Output incorrectly lists Levenshtein distance as 2.

Anonymous 
Printed Page 87
the code in the Solution

in the book:
boolean nameReadable = PropertyUtils.isReadable( book, "name");
boolean nameReadable = PropertyUtils.isWritable( book, "name");

should be:
boolean nameReadable = PropertyUtils.isReadable( book1, "name");
boolean nameReadable = PropertyUtils.isWritable( book1, "name");

comments:
should be "book1" instead of "book"

Anonymous 
Printed Page 88
There is a missing line, the predicateArray is referenced

without being defined. The following changes are necessary:

// A Predicate that returns true if the "name" property is not null
Predicate teamNotNull = new BeanPredicate( "name", new NotNullPredicate( ) );

// A Predicate that returns true if the "coach.firstName" property
// is "Tom"
Predicate coachFirstName = new BeanPredicate( "coach.firstName",

new EqualsPredicate("Tom") );

// Tie two Predicates together into an AndPredicate
Predicate validateTeam = new AllPredicate( predicateArray );

should read:

// A Predicate that returns true if the "name" property is not null
Predicate teamNotNull = new BeanPredicate( "name", new NotNullPredicate( ) );

// A Predicate that returns true if the "coach.firstName" property
// is "Tom"
Predicate coachFirstName = new BeanPredicate( "coach.firstName",

new EqualsPredicate("Tom") );

Predicate[] predicateArray = new Predicate[] { teamNotNull, coachFirstName };

// Tie two Predicates together into an AndPredicate
Predicate validateTeam = new AllPredicate( predicateArray );

Anonymous 
Printed Page 94
Code references an unknown variable due to typo. Code should be changed as follows

BasicDynaClass politicianClass =
new BasicDynaClass( "politician", BasicDynaBean.class, props );

should read:

BasicDynaClass politicianClass =
new BasicDynaClass( "politician", BasicDynaBean.class, beanProperties );

Anonymous 
Printed Page 95
See Also of 3.18

The See Also section is incorrect. Those things are not covered in the book.

Anonymous 
Printed Page 108
Example 4-4

Unintended errata: The suit order isn't right for official
Poker or Bridge. To sort in official order, please replace:

private String[] suitOrder = { "S", "C", "D", "H" };

with

private String[] suitOrder = { "C", "D", "H", "S" };

Anonymous 
Printed Page 137
Recipe 5.4

Chapter 5, Recipe 5.4

EarthQuake quake1 = new EarthQuake( );
quake1.setLocation( "Chicago, IL" );
quake1.setIntensity( new Float( 6.4f ) );
quake1.setIntensity( new Float( 634.23f ) ); <--- setDepth
quake1.setTime( new Date( ) );
quakes.add( quake1 );
EarthQuake quake2 = new EarthQuake( );
quake2.setLocation( "San Francisco, CA" );
quake2.setIntensity( new Float( 4.4f ) );
quake2.setIntensity( new Float( 63.23f ) ); <--- setDepth
quake2.setTime( new Date( ) );
quakes.add( quake2 );

Anonymous 
Printed Page 137
Recipe 5.4 / Example 5-1;should be

public void setIntensity(Float intensity) { this.intensity = intensity; } <---
setIntensity

Anonymous 
Printed Page 138
"majorQuakes.hasMore()" should be "majorQuakes.hasNext()"

Anonymous 
Printed Page 183
Table

getBooleanBalue should be getBooleanValue

Anonymous 
Printed Page 229

Chapter 8: "There were significant changes between the pre-release
version of Commons Math and the 1.0 release of Commons Math. All of the
concepts introduced in Chapter 8 of the Commons Cookbook remain valid,
but many of the code examples will not compile as written. You will
need to consult the Commons Math API in the 1.0 release."

Anonymous 
Printed Page 256 - 9.3
code example line 11.

There should not be a semi-colon after the line 10.

String expr =
"${opera.name} was composed by ${opera.composer} in ${opera.year}. ";
"This opera has ${opera.acts.size( )} acts, and it is performed in " +
"${opera.language( )}";

Should read:

String expr =
"${opera.name} was composed by ${opera.composer} in ${opera.year}. " +
"This opera has ${opera.acts.size( )} acts, and it is performed in " +
"${opera.language( )}";

Anonymous 
Printed Page 256
The following line of code should follow

"opera.setYear(1791);":

opera.setLanguage("German")

Anonymous 
Printed Page 256
"${opera.language()}" should be "${opera.language}".

Anonymous 
Printed Page 258
In the sorting example, there is a missing line in the code

example, which will cause every ball to end up in the Misc-bin. A break
neds to be added after the call to sendBall() as follows:

if( result.booleanValue() == true ) {
sendBall( ball, basket );
}

Should read:

if( result.booleanValue() == true ) {
sendBall( ball, basket );
break;
}

Anonymous 
Printed Page 258
basket is an undefined variable.

"sendBall(ball, basket );"
should read
"sendBall( ball, bin );"

Anonymous 
Printed Page 290

"FileUtils.sizeOfDirectory()"
should read
"FileUtils.sizeOfDirectory(dir)"

Anonymous 
Printed Page 292
Last paragraph

".htm" is split across lines as if it were ". htm"

Anonymous 
Printed Page 320
Paragraph under discussion

MIME is Multipurpose Internet Mail Extensions, not Main Extensions.

Anonymous 
Printed Page 330
First paragraph

The sentence
"If ALLOW_CIRCULAR_REDIRECTS is set to true,"
should read
"If ALLOW_CIRCULAR_REDIRECTS is set to false,"

Anonymous 
Printed Page 341
Paragraph under discussion

XPath is generally used by select nodes in an XML document...
should be:
XPath is generally used to select nodes in an XML document...

Anonymous 
Printed Page 349
line eight of the example is incomplete.

It reads:
logger.info( "Looking for XML files in "
it should be:
logger.info( "Looking for XML files in " + dataDir.getAbsolutePath() );

Anonymous