Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Re: No WEAVEINFO messages for cflow pointcuts!

Yes, cflowentry advice kinds are not covered by the if() statement.
It's a decision from long ago (can't remember why).  You could attach
an advice to the 'cflowentry' piece of your pointcut and that will
give you the weave info:

before(): getA() {}

you can raise an enhancement request if you like.

Andy.

On 11/06/07, Heiko Seeberger <heiko.seeberger@xxxxxxxxxxxxx> wrote:
Hi Andy,

Thank you for your quick response!

Sorry for being inaccurate: When using a cflow pointcut in an around
advice I run into the depicted problem.

My aspect is:

public aspect Aspect {

     pointcut getA() : execution(String a.internal.A.getA());

     pointcut getB() : execution(String b.internal.B.getB());

     String around() : getB() && cflow(getA()) {
         System.out.println("getB() && cflow(getA())");
         return "Aspect";
     }
}

In the if() statement the debugger sais: aKind.toString() -> "cflowEntry".

But CflowEntry AdviceKinds are not covered by the if() statement.

Regards,
Heiko


Andy Clement schrieb:
> The if() statement you quote is talking about kinds of advice - but
> your message talks about pointcuts???
>
> That if() statement will allow for advice attached to cflow pointcuts
> just fine:
>
> public aspect A {
>
>  before(): cflow(call(* m2(..))) && withincode(* m(..)) { }
>
>  public void m() {m2();}
>  public void m2() {}
>
> }
>
> ajc -showWeaveInfo A.java
>
> Join point 'method-call(void A.m2())' in Type 'A' (A.java:5) advised
> by before advice from 'A' (A.java:3) [with runtime test]
>
> On 11/06/07, Heiko Seeberger <heiko.seeberger@xxxxxxxxxxxxx> wrote:
>> Hi,
>>
>> I am using AJEER (http://ajeer.sourceforge.net/) which is a
>> load-time-weaving enabler for the eclipse Runtime. AJEER itself relies
>> on the AspectJ LTW API.
>>
>> When using pointcuts with cflow(...) I run into serious trouble, because
>> AJEER relies on WEAVEINFO messages which seem only to be generated for
>> certain "interesting" pointcuts.
>>
>> See org.aspectj.weaver.Shadow.reportWeavingMessage(...):
>>                 // Only report on interesting advice kinds ...
>>                 ...
>>                 if (!( aKind.equals(AdviceKind.Before) ||
>>                        aKind.equals(AdviceKind.After) ||
>>                        aKind.equals(AdviceKind.AfterReturning) ||
>>                        aKind.equals(AdviceKind.AfterThrowing) ||
>>                        aKind.equals(AdviceKind.Around) ||
>>                        aKind.equals(AdviceKind.Softener))) return;
>>
>> I kindly request help form the AJ gurus for that:
>> Why are cflow pointcuts not interesting?
>> Is there a chance to fix this?
>>
>> Regards,
>> Heiko
>>
>> _______________________________________________
>> aspectj-users mailing list
>> aspectj-users@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>>

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users



Back to the top