Skip to main content

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



Wes Isberg wrote:
I get the compilation error "Uses more than one .. in args"

AFAIK this is an implementation limitation having to do with ambiguity in patterns like args(.., String, ..), but I can't think
of an illustrative case offhand.

I think this has been removed after ajc 1.0.6.
If I remember well, it used to match the last of the list in case of ambiguities. I think this could easily cause some problems, especially if args matches the runtime type and not the signature type. For example:

Using a method like this:
   void test (ClassA a, String s, Object obj, ClassB b) { ... }

used like this:

test(a,"A",new Object(),b)
test(a,"A","B",b)

a pointcut like this:
   pointcut(String s): call(* *.test(..)) && args(..,s,..)

would bind s to "A" in the first call and s to "B" in the second.
Not really intuitive...



Bruno.


Back to the top