[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Args pointcut

Hi all,

The programming guide,
http://www.eclipse.org/aspectj/doc/released/progguide/semantics-pointcuts.ht
ml,

in describing the args pointcut, says:

"args(Type or Id, ...)
Picks out each join point where the arguments are instances of the
appropriate type (or type of the identifier if using that form). A null
argument is matched iff the static type of the argument (declared parameter
type or field type) is the same as, or a subtype of, the specified args
type."

What is the rationale behind matching null arguments? If I want to match
only actual instances of a class, not null values, is there any way I can do
that except collect the context and check for null in the advice?

Another args question:

>From the eclipse AspectJ book (p. 190) I get the impression that one can
write e.g. args(.., String, ..) to match an argument list where some
argument is of type String with possibly other arguments before and after,
as long as I only specify type and not an identifier (as that could be
ambiguous). However, I get the compilation error "Uses more than one .. in
args" when trying this. Does that mean only one .. is allowed even in this
case?

Jon

http://www.eecs.wsu.edu/~jbaekken/