My understanding is that ..
is 0-Many
args and *
is one arg of any
name. Is this correct?
Does aspectj support syntax like args(..,myArg,..)
?
My understanding is that ..
is 0-Many
args and *
is one arg of any
name. Is this correct?
Does aspectj support syntax like args(..,myArg,..)
?
This is from AspectJ site: http://www.eclipse.org/aspectj/doc/next/progguide/semantics-pointcuts.html
*
represents any number of characters except "."
..
represents any number of characters including any number of "."
Update From AspectJ in Action - for method signatures:
In method signatures, the wildcard .. is used to denote any type and number of arguments taken by a method
*
specifies a single argument
Others have answered part of the question before me, so I will only amend:
.., bla, ..
does not work because if you bind parameter bla
to a variable, there might be several matching combinations in case a matching type occurs multiple times in the parameter list. Example:
void foo(int a, String b, String c, File d)
Now what should happen if the advice is:
before(String bla) : call(void foo(.., bla, ..)) && args(bla)
Should bla
be bound to the String
value of b
or c
?