langtools/src/share/classes/com/sun/tools/javac/comp/Check.java
changeset 21041 99f5e5e97425
parent 21025 9d4e765fe447
child 21488 4a69e26aa999
equal deleted inserted replaced
21040:3e32f68d2151 21041:99f5e5e97425
  2767 
  2767 
  2768     public void validateTypeAnnotation(JCAnnotation a, boolean isTypeParameter) {
  2768     public void validateTypeAnnotation(JCAnnotation a, boolean isTypeParameter) {
  2769         Assert.checkNonNull(a.type, "annotation tree hasn't been attributed yet: " + a);
  2769         Assert.checkNonNull(a.type, "annotation tree hasn't been attributed yet: " + a);
  2770         validateAnnotationTree(a);
  2770         validateAnnotationTree(a);
  2771 
  2771 
  2772         if (!isTypeAnnotation(a, isTypeParameter))
  2772         if (a.hasTag(TYPE_ANNOTATION) &&
       
  2773                 !a.annotationType.type.isErroneous() &&
       
  2774                 !isTypeAnnotation(a, isTypeParameter)) {
  2773             log.error(a.pos(), "annotation.type.not.applicable");
  2775             log.error(a.pos(), "annotation.type.not.applicable");
       
  2776         }
  2774     }
  2777     }
  2775 
  2778 
  2776     /**
  2779     /**
  2777      * Validate the proposed container 'repeatable' on the
  2780      * Validate the proposed container 'repeatable' on the
  2778      * annotation type symbol 's'. Report errors at position
  2781      * annotation type symbol 's'. Report errors at position