Actually I am on the road, so this is an untested, unverified response.

>       @Around( "execution( (@ImmutableCollection *) *(..)

I think here your are targetting a method the return type (not the return 
value) of which is annotated by @ImmutableCollection. I do not know if it 
works, but maybe you want to try

    execution( (@ImmutableCollection (*)) *(..) )

If I am wrong probably Andy Clement or Andrew Eisenberg will correct me anyway. 
:-)

Regards
Alexander Kriegisch



Am 06.05.2013 um 19:32 schrieb Jay Roberts <[email protected]>:

> I have a simple test case that isn't working, but it seems like it should, 
> could use a bit of help.
> 
> I have:
> 
>       public class TestReturnAnnotation{
>               public Object object=null;
>               public @ImmutableCollection Object getObject(){
>                       return object;
>               }
>       }
> 
> 
> And from the advice:
> 
>       @Around( "execution( (@ImmutableCollection *) *(..))")
> 
> This compiles ok, but the advice does not get applied to 
> TestReturnAnnotation.getObject().  Looking at the spec for MethodPattern, it 
> seems like it should, but I'm obviously missing something.  FWIW, in the 
> aspect, I have another advice
> 
>       @Around( "set(@ImmutableCollection * *) && args(newVal) && target(t)")
> 
> That is working fine.  Can I have two @Around in the same @Aspect class?
> 
> Thanks!
> 
> Jay Roberts
> _______________________________________________
> aspectj-users mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to