Uploaded image for project: 'CDI Specification Issues'
  1. CDI Specification Issues
  2. CDI-744

errorprone.info bugpattern GetClassOnAnnotation

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Minor Minor
    • None
    • 2.0.SP1
    • Decorators
    • None
    • Low

      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() + "."'?

              Unassigned Unassigned
              johnwestbrook John Westbrook (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: