The javadoc of the @Timed annotation says: "This annotation may be used as a meta-annotation to create custom composed annotations."
The @Inherited annotation is missing, so @Timed cannot be used to create meta-annotation. We should add the @Inherited annotation to be respect the javadoc or omit the meta-annotation line from javadoc.
// Steps to reproduce the problem:
@Timed(millis = 5000L)
@Retention(RUNTIME)
@Target(TYPE)
@interface MetaAnnotation {}
@MetaAnnotation
class TargetClass {
}
Timed timed = TargetClass.class.getAnnotation(Timed.class);
// timed is null
Comment From: pivotal-issuemaster
@Ammar0 Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.
Comment From: pivotal-issuemaster
@Ammar0 Thank you for signing the Contributor License Agreement!
Comment From: Ammar0
The @Timed and @Repeat annotations have the same problem.
The Javadoc says they are meta-annotation but they are not.
I have created another branch to submit a fix for both annotations.
Comment From: rstoyanchev
@Ammar0 please use backticks to escape annotations which otherwise are interpreted as mentions and generate notifications.