Errata

AspectJ Cookbook

Errata for AspectJ Cookbook

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 "Date 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 Note Update

Version Location Description Submitted By Date submitted Date corrected
Printed
Page 43
4th line

the following line of code

if (message.equals("</body>
"));

should be replaced by

if (message.indexOf("</body>") != -1);

in order to obtain the result as shown in fig 3-11

Anonymous    Oct 16, 2015
Printed
Page 59
4th paragraph

http://www.xs.iastate.edu/~leavens/foal/papers-2004/barzilay-etal.pdf
should be
http://www.cs.iastate.edu/~leavens/FOAL/papers-2004/barzilay-etal.pdf

Anonymous    Oct 16, 2015
Printed
Page 116
example12-1

the pointcut:

pointcut ifJoinPointThisHasRealisticSalaryPointcut() : if (
thisJoinPoint.getThis() instanceof MyClass
&& ((MyClass) thisJoinPoint.getThis()).getSalary()
< realisticSalary
&& ((MyClass) thisJoinPoint.getThis()).getSalary() > 0)
&& !withincode(* MyClass.get*());

should be

pointcut ifJoinPointThisHasRealisticSalaryPointcut() : if (
(thisJoinPoint.getThis() instanceof MyClass)
&& ((MyClass) thisJoinPoint.getThis()).getSalary()
< realisticSalary
&& ((MyClass) thisJoinPoint.getThis()).getSalary() > 0)
&& !withincode(* MyClass.get*())
&& !execution(* MyClass.get*());

Anonymous    Oct 16, 2015
Printed
Page 137
1st paragraph

the text
"according to whether the proceed() call is made from within the around() advice block."
is printed twice

Anonymous    Oct 16, 2015
Printed
Page 156
Figure 14-4

Where the aspect objects are shown, instead of being of type "PerThis" they should be
of type "PerControlFlow".

Anonymous   
Printed
Page 170
1st line

... mechanisms shown in Recipe 12.1 ...
should be
... mechanisms shown in Recipe 16.1 ...

Anonymous    Oct 16, 2015
Printed
Page 174
last line

the website for aTrack should be https://atrack.dev.java.net/ and not https://atrack.java.net

Anonymous    Oct 16, 2015
Printed
Page 230
example 19-13

private Strategy Context.strategy = null;
is useless, and not used to implement the strategy pattern.
It should not be in the example.

Anonymous    Oct 16, 2015
Printed
Page 234
figure 19-26

the interface CompositeElement extends the interface Element. This is not shown in
the figure. The figure 19-28 has the same issue.
The figures should really show this relationship as they show all the others.

Anonymous   
Printed
Page 303
Code at tope of page - Example 23-4

Where each of the within(..) statements are made the end of the TypePatterns should
have two periods followed by an asterisk.

i.e.

Where the pointcuts read:

within(com.oreilly.aspectjcookbook.testing.+)

they should read:

within(com.oreilly.aspectjcookbook.testing..*)

This is true for the withinTestingRegion, withinMyApp and withinThirdParty pointcut
declarations.

Anonymous    Oct 16, 2015