Better, Faster, Lighter Java
by Bruce A. Tate, Justin Gehtland
The following errata *corrected* in the 4/05 reprint:
(xv) 4th paragraph, 7th line:
"Clinton Began"
NOW READS:
"Clinton Begin:
{13} In code example 1-4;
private string name;
NOW READS:
private String name;
{14} In code example 1-4;
public void setName(long newName) {
NOW READS:
public void setName(String newName)
AND
public string getName() {
NOW READS:
public String getName() {
(22) In "Over-specialization" paragraph, ending;
"...programmers from testers, and code from the warning, healing light of day."
NOW READS:
"...programmers from testers, and code from the warming, healing light of day."
{44} block of method definitions after 1st paragraph;
public void isValid(String accountNumber) {}
NOW READS::
public boolean isValid(String accountNumber) {}
{77} towards the top of page;
Here's the code to invoke a method called sum on class Adder that takes...
NOW READS:
Here's the code to invoke a method called add on class Adder that takes...
AND
// target object is called "target"
Class c = Class.forName("Adder");
Class parameterTypes[] = new Class[2];
parameterTypes[0] = Integer.TYPE;
parameterTypes[1] = Integer.TYPE;
Method m = c.getMethod("sum", parameterTypes);
Object parms[] = new Object[2];
parms[0] = new Integer(1);
parms[1] = new Integer(1);
Integer returnValue = (Integer)m.invoke(target, parms);
NOW READS:
// target object is called "target"
Class c = Class.forName("Adder");
Class parameterTypes[] = new Class[2];
parameterTypes[0] = Integer.TYPE;
parameterTypes[1] = Integer.TYPE;
Method m = c.getMethod("add", parameterTypes);
Object parms[] = new Object[2];
parms[0] = new Integer(1);
parms[1] = new Integer(1);
Integer returnValue = (Integer) m.invoke(null, parms);
(132), 2nd para from bottom,
Previously there was an extra period at the end of the sentence "existing code still use
them.." This HAS BEEN CORRECTED.
(134) setUser method
public void setUser(String u) {
user = u;
}
NOW READS:
public void setUser(User u) {
user = u;
}
(134) bottom of the page;
Previously, the getBody and setBody methods were repeated.
The last 4 lines on page 134 and the first 3 lines on 135
HAVE BEEN DELETED to correct this.
{156} Bottom (the beans XML segment); 2nd to last line on the page;
NOW READS:
(157) Annotation line 1 at the bottom;
Previously there was an extra blank line before the after
the (1).
This HAS BEEN DELETED.
(161) Paragraph above "Adding Persistence" header;
Line 3 of the paragraph that starts with "I call this model passive."
"object, although it does have private properties and public fields It has
business meth-"
NOW READS:
"object, although it does have private properties and public fields. It has
business meth-"
[162] Middle of the page: in the setProductId() method;
public void setProductId(String productId) {this.productId =
productId.trim();}
NOW READS:
public void setProductId(String productId) {this.productId = productId;}
(164) Top of the page, after the first paragraph,caption for Example 8.5;
Example 8-5. ProductDAO.java
NOW READS:
Example 8-5. ProductDao.java
(166) Second Text paragraph before the Example 8-8 caption,last word of the paragraph;
ProductDAO
NOW READS:
ProductDao
[167] After example 8-8, annotation explanations (for both 1 and 2);
"(includes the bold text)"
The phrase "(includes the bold text)" HAS BEEN REMOVED from both.
[167] Bottom of page: Example 8-9 caption;
"dataAccessContext-local.xml"
NOW READS:
"dataAccessContext.xml"
(177) 3rd paragraph, 3rd sentence after the semi-colon;
'll walk you through the decision-making process.."
NOW READS:
I'll walk you through the decision-making process.."
(209) Last line;
"First, create an instead of ConfigBean..."
NOW READS:
"First, create an instance of ConfigBean..."