开发者

Multiple arguments with around advice

开发者 https://www.devze.com 2023-03-09 16:23 出处:网络
I am given a method in a class like开发者_开发知识库 this.. public int foo(String a,String b){}

I am given a method in a class like开发者_开发知识库 this..

public int foo(String a,String b){}

Now I want to apply a pointcut at this point and using around advice I want to alter the second argument.

public aspect Aspect {  
      int around(String s): call(int foo(Object,String)) && args(i) {
      int i = proceed(i.concat("hello"));
      return i;
      }
}

But I am not able to do so..Its giving me the error that Aspect has not been applied. adviceDidnotMatch..

Any help please..I am stuck..:-/ Thanks in advance..


Your proceed() and around() don't match.
proceed() should be called with both arguments.

0

精彩评论

暂无评论...
验证码 换一张
取 消