Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » pointcut doesn't match one of two methods.
pointcut doesn't match one of two methods. [message #55215] Mon, 18 July 2005 08:41 Go to next message
Michael Moser is currently offline Michael MoserFriend
Messages: 914
Registered: July 2009
Senior Member
I have two methods:
protected boolean evaluate() throws Exception { ... }
and
protected boolean evaluate(final int i) throws Exception { ... }

I am trying to define a pointcut that matches both of them.

I tried:
pointcut exec_evaluate(Foo bar) :
execution(boolean Foo.evaluate(..)) && target(bar);

pointcut exec_evaluate(Foo bar) :
execution(boolean Foo.evaluate(*)) && target(bar);

pointcut exec_evaluate(Foo bar) :
(execution(boolean Foo.evaluate()) && target(bar)) ||
(execution(boolean Foo.evaluate(int)) && target(bar));

But all of these only match the second method (i.e. the one with the int
parameter) but not the parameterless method. What am I doing wrong or
what am I missing here???

Michael
Re: pointcut doesn't match one of two methods. [message #55243 is a reply to message #55215] Mon, 18 July 2005 08:49 Go to previous message
Michael Moser is currently offline Michael MoserFriend
Messages: 914
Registered: July 2009
Senior Member
Sorry,
the 1st as well as the last method both work.

Apparently the problem was, that AJDT somehow wouldn't rebuild and/or
update the display properly.
Obviously AJDT occasionally requires SEVERAL build clean to get onto its
feet again...

Michael (very relieved that his understanding of AspectJ wasn't THAT
severely broken :-) )


"Michael Moser" <mmo@zurich.ibm.com> wrote in message
news:dbfq0h$ruc$1@news.eclipse.org...
>I have two methods:
> protected boolean evaluate() throws Exception { ... }
> and
> protected boolean evaluate(final int i) throws Exception { ... }
>
> I am trying to define a pointcut that matches both of them.
>
> I tried:
> pointcut exec_evaluate(Foo bar) :
> execution(boolean Foo.evaluate(..)) && target(bar);
>
> pointcut exec_evaluate(Foo bar) :
> execution(boolean Foo.evaluate(*)) && target(bar);
>
> pointcut exec_evaluate(Foo bar) :
> (execution(boolean Foo.evaluate()) && target(bar)) ||
> (execution(boolean Foo.evaluate(int)) && target(bar));
>
> But all of these only match the second method (i.e. the one with the
> int parameter) but not the parameterless method. What am I doing wrong
> or what am I missing here???
>
> Michael
>
Re: pointcut doesn't match one of two methods. [message #589518 is a reply to message #55215] Mon, 18 July 2005 08:49 Go to previous message
Michael Moser is currently offline Michael MoserFriend
Messages: 914
Registered: July 2009
Senior Member
Sorry,
the 1st as well as the last method both work.

Apparently the problem was, that AJDT somehow wouldn't rebuild and/or
update the display properly.
Obviously AJDT occasionally requires SEVERAL build clean to get onto its
feet again...

Michael (very relieved that his understanding of AspectJ wasn't THAT
severely broken :-) )


"Michael Moser" <mmo@zurich.ibm.com> wrote in message
news:dbfq0h$ruc$1@news.eclipse.org...
>I have two methods:
> protected boolean evaluate() throws Exception { ... }
> and
> protected boolean evaluate(final int i) throws Exception { ... }
>
> I am trying to define a pointcut that matches both of them.
>
> I tried:
> pointcut exec_evaluate(Foo bar) :
> execution(boolean Foo.evaluate(..)) && target(bar);
>
> pointcut exec_evaluate(Foo bar) :
> execution(boolean Foo.evaluate(*)) && target(bar);
>
> pointcut exec_evaluate(Foo bar) :
> (execution(boolean Foo.evaluate()) && target(bar)) ||
> (execution(boolean Foo.evaluate(int)) && target(bar));
>
> But all of these only match the second method (i.e. the one with the
> int parameter) but not the parameterless method. What am I doing wrong
> or what am I missing here???
>
> Michael
>
Previous Topic:pointcut doesn't match one of two methods.
Next Topic:How to programmatically create an aspect AST ?
Goto Forum:
  


Current Time: Fri Dec 27 01:00:35 GMT 2024

Powered by FUDForum. Page generated in 0.03084 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top