The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

David_W (70) [Avatar] Offline
#1
The pointcut
pointcut uiCall() : call(* java.awt.*+.*(..));
should actually be
pointcut uiCall() : call(* java.awt..*+.*(..));
to include subpackages.
David_W (70) [Avatar] Offline
#2
Re: listing 11.20
also, the pointcut
pointcut staticMemberAccess() : #4
set(static * *) && EJBPointcuts.inEJB(); #4

should probably be
pointcut staticMemberAccess() : #4
set(!final static * *) && EJBPointcuts.inEJB(); #4

to allow setting of final static fields.
ramnivas (171) [Avatar] Offline
#3
Re: listing 11.20
EJB specification is little vague in what exactly isn't allowed. For example, it will be okay to use the java.awt.geom package.

I have incorporated the suggested change, since it is better to err on the side of caution.

-Ramnivas
ramnivas (171) [Avatar] Offline
#4
Re: listing 11.20
AspectJ won't have a join point for setting of a final variable. So the aspect is correct without the change (it will also be correct with the change).

-Ramnivas
David_W (70) [Avatar] Offline
#5
Re: listing 11.20
True, but the lack of a join point for a final static var is, as you said before, an implementation issue with Java. Someone reading the book might not know this, and wonder why the pointcut APPEARS to be disallowing static finals.

Picky point, maybe.
ramnivas (171) [Avatar] Offline
#6
Re: listing 11.20
I have been pondering this. It seems it is better to add !final to remove any doubts, especially since it is better expression of the policy.

-Ramnivas