Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] The problem in cflow point cut while usinh ajdt tool for eclipse version 3.1.2

Hello Ajay,

>   1. I  am getting warning at the compile time that
>   " can not build join point lazily for this advice since it has no suitable
>  guard[Xlint:noGuardForLazyTjp]"

Discussion of this warning comes up now and again on the list, see
here: http://dev.eclipse.org/mhonarc/lists/aspectj-users/msg05984.html

Basically using thisJoinPoint is not cheap - and by inclusion of an
extra piece on your pointcut we can optimize and build it lazily, ie.
only if the advice will actually run.  If you just use the static
components of the thisJoinPoint object it is much cheaper.  In your
case you might have a global trace control flag (perhaps in addition
to other more granular flags) and you could add '&&
if(tracingEnabled)' to your pointcuts.

>   2. At run time I am getting  following error :-
>       "Exception in thread "main" java.lang.StackOverflowError"

this means the advice is calling itself over and over and is due to
the nature of the cflow() implementation.  Is your aspect (and advice)
in one of the ccc.* packages?  I'd avoid using cflow for a tracing
aspect if you can - are you sure you need it?

This article from a while back discusses writing good tracing aspects,
lazytjp, etc: http://dev.eclipse.org/mhonarc/lists/aspectj-dev/msg01259.html

cheers,
Andy.

2008/4/28 ajayks <ajay-csf.kumar@xxxxxx>:
>
>  Dear All,
>  I am new in aspectJ programming and currently  am evaluating it for using it
>  in my one of the coming project.
>  I  want use following point cut in my aspect:-
>
>  pointcut Tracing() :  (execution( public void ccc.ClassName2.*()));
>  pointcut flow() : cflow(Tracing()) && within(ccc.*) ;
>
>  the flow() pont cut used in before advice like this :-
>
>  before() :flow()
>                  {
>                         System.out.println("entering: "+thisJoinPoint );
>
>                  }
>
>  The follwoing problem I am getting :
>   1. I  am getting warning at the compile time that
>   " can not build join point lazily for this advice since it has no suitable
>  guard[Xlint:noGuardForLazyTjp]"
>   2. At run time I am getting  following error :-
>       "Exception in thread "main" java.lang.StackOverflowError"
>
>  can any one help me out what is the problem how it can be solved. I am using
>  ajdt tool for eclipse version
>  3.1.2.
>  best regards,
>  Ajay Kumar
>  ST Microelectronics Ltd.
>
>
>
>  --
>  View this message in context: http://www.nabble.com/The-problem-in-cflow-point-cut-while-usinh-ajdt-tool-for-eclipse-version-3.1.2-tp16952898p16952898.html
>  Sent from the AspectJ - users mailing list archive at Nabble.com.
>
>  _______________________________________________
>  aspectj-users mailing list
>  aspectj-users@xxxxxxxxxxx
>  https://dev.eclipse.org/mailman/listinfo/aspectj-users
>


Back to the top