Errata

What's New in Java 7

Errata for What's New in Java 7

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.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
PDF Page 1
Using strings in switch statements

Old and new version of code is not logically compatible.
Old version of code compares strings ignoring case.

New version of code does not.
Suggested change to new code:


public void processTrade(Trade t) {
String status = t.getStatus();

switch (status.toUpperCase()) {
case NEW:
newTrade(t);
break;
case EXECUTE:
executeTrade(t);
break;
case PENDING:
pendingTrade(t);
break;
default:
break;
}
}

Jan ?hrstr?m  Jun 28, 2012 
Other Digital Version 9-10
bulletpoints 2 and 3

Under bullet point 2, the variable path is set, and under bullet point 3 the variable dirToWatch is set. I can't find any reference to where else path is used, and can't see where dirToWatch came from, and additional research leads me to believe that these should be the same variable.

Christopher Bain  Apr 08, 2012