[cdi-dev] [JBoss JIRA] (CDI-744) errorprone.info bugpattern GetClassOnAnnotation

John Westbrook (Jira) issues at jboss.org
Wed May 29 13:44:00 EDT 2019


John Westbrook created CDI-744:
----------------------------------

             Summary: errorprone.info bugpattern GetClassOnAnnotation
                 Key: CDI-744
                 URL: https://issues.jboss.org/browse/CDI-744
             Project: CDI Specification Issues
          Issue Type: Bug
          Components: Decorators
    Affects Versions: 2.0.SP1
         Environment: https://bazel.build
            Reporter: John Westbrook


api/src/main/java/javax/enterprise/util/AnnotationLiteral.java:84: error: [GetClassOnAnnotation] Calling getClass() on an annotation may return a proxy class
            if (members.length > 0 && !annotationType().isAssignableFrom(this.getClass())) {
                                                                                      ^
    (see https://errorprone.info/bugpattern/GetClassOnAnnotation)
  Did you mean 'if (members.length > 0 && !annotationType().isAssignableFrom(this.annotationType())) {'?


api/src/main/java/javax/enterprise/util/AnnotationLiteral.java:117: error: [GetClassOnAnnotation] Calling getClass() on an annotation may return a proxy class
            Class<?> annotationLiteralSubclass = getAnnotationLiteralSubclass(this.getClass());
                                                                                           ^
    (see https://errorprone.info/bugpattern/GetClassOnAnnotation)
  Did you mean 'Class<?> annotationLiteralSubclass = getAnnotationLiteralSubclass(this.annotationType());'?


api/src/main/java/javax/enterprise/util/AnnotationLiteral.java:278: error: [GetClassOnAnnotation] Calling getClass() on an annotation may return a proxy class
            throw new IllegalArgumentException("Annotation member value " + instance.getClass().getName() + "."
                                                                                             ^
    (see https://errorprone.info/bugpattern/GetClassOnAnnotation)
  Did you mean 'throw new IllegalArgumentException("Annotation member value " + instance.annotationType().getName() + "."'?




--
This message was sent by Atlassian Jira
(v7.12.1#712002)


More information about the cdi-dev mailing list