Reports attempts to reflectively check for the presence of a non-runtime annotation.

Using Class.isAnnotationPresent() to test for an annotation whose retention policy is set to SOURCE or CLASS (the default) will always have a negative result. This mistake is easy to overlook.

Example:


  {
    getClass().isAnnotationPresent(SourceAnnotation.class); //always false
  }

  @Retention(RetentionPolicy.SOURCE)
  @interface SourceAnnotation {}