0

I have this annotation defined:

public @interface MyAspectWeaved { }

And this aspect:

aspect MyAspect {
   declare @method : * *(..) : @MyAspectWeaved;
   // Other pointcuts and advices which work without issues
   // ...
}

I'm basically trying to mark all methods which could have been affected by MyAspect. The rest of the aspect works fine but for some reason no methods are annotated with @MyAspectWeaved. Google searches and rereading the documentation didn't give me any clues. I'm not very familiar with AspectJ so I assume that either I'm missing something obvious or my understanding of declare @method is incorrect. Anyone see what's wrong?

I'm using AspectJ 1.6.12.

Thanks

1 Answer 1

0

You have to change the annotation to:

@Retention(RetentionPolicy.RUNTIME)
public @interface MyAspectWeaved {
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.