Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] LTW, javaagent, JUnit and ANT integration

When you write
      call(* Service+.print(..)) && @annotation(MemberOfMonitoredSet);
That means to match any join point shadow that is a call to methods
print(..) declared on subtypes of Service, and whose declaration is
annotated by the annotation MemberOfMonitoredSet (ie the method is
annotated).

In your case the annotation is a class level one on the interface 
implemented by the declaring type.

You thus need a different pointcut (or move the annotation to the method).
I am sure using AJDT is the best way to better understand how the
@annotation pointcut designator behaves.

The doc (AspectJ 5 dev. book) explains that better than I do I guess:
The @annotation pointcut designator matches any join point where the
subject of the join point has an annotation of the given type.
And see http://eclipse.org/aspectj/doc/next/adk15notebook/join-point-modifiers.html
for what the "subject" means.

Alex

On 8/10/05, Valerio Schiavoni <ervalerio@xxxxxxxxxx> wrote:
> Alexandre Vasseur ha scritto:
> 
> >I'll commit a test case. If you can isolate the issue with your
> >fractal generated class please open a bugzilla issue.
> >Thanks
> >Alex
> >
> >
> just to be sure, i did a simple small case without generated classes,
> but with corresponding java files (or a simplified version with relevant
> annotations inside).
> I'll attach to this email, it's enough untar the ltwtest.tgz, it will
> create a ltwtest directory.
> then to copy aspectjrt.jar  aspectjtools.jar  aspectjweaver.jar inside a
> ltwtest/externals directory
> and launch :
> ant compile test
> 
> the aspect is not applied, even if i think it's properly written: again,
> the pointcut is for call to  method  print taking any parameter on
> objects istances of classes implementing the Service interface or its
> subinterfaces, which contains an annotation:
> 
>  pointcut annotatedResourceInvocation():
>       call(* Service+.print(..)) && @annotation(MemberOfMonitoredSet);
> 
> When this will pass, we'll try to investigate why the testcase with
> corresponding generated classes is not working.
> 
> Valerio
> 
> 
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
> 
> 
> 
>


Back to the top