src/share/classes/com/sun/tools/javac/comp/Check.java

changeset 2134
b0c086cd4520
parent 2118
d8d6b58f1ebf
child 2157
963c57175e40
equal deleted inserted replaced
2133:19e8eebfbe52 2134:b0c086cd4520
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

mercurial