Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Pointcut to a Collection.add() method on a particular type of argument?

I'm trying to write a pointcut against a Collection.add() method given a specific type of argument, but everytime I specify the argument type the pointcut fails to advise.

Given the following code:
List<String> x = new ArrayList<String>();
x.add("Some String)";

This works:

pointcut addEntity():  call( * java.util.Collection+.add( * ));

However, this does not:

pointcut addEntity():  call( * java.util.Collection+.add( java.util.String ));


Is there a specific reason why I cannot specify the type of argument I want to advise against? 

Thanks,

Eric


Back to the top