langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java
changeset 43279 9afb33b0a3ab
parent 43139 1d768b91ae4b
child 43588 6a0e0ea0e93b
equal deleted inserted replaced
43278:e9f4ee9bfd86 43279:9afb33b0a3ab
  2818     /** Check an annotation of a symbol.
  2818     /** Check an annotation of a symbol.
  2819      */
  2819      */
  2820     private void validateAnnotation(JCAnnotation a, Symbol s) {
  2820     private void validateAnnotation(JCAnnotation a, Symbol s) {
  2821         validateAnnotationTree(a);
  2821         validateAnnotationTree(a);
  2822 
  2822 
  2823         if (!annotationApplicable(a, s))
  2823         if (a.type.tsym.isAnnotationType() && !annotationApplicable(a, s))
  2824             log.error(a.pos(), "annotation.type.not.applicable");
  2824             log.error(a.pos(), "annotation.type.not.applicable");
  2825 
  2825 
  2826         if (a.annotationType.type.tsym == syms.functionalInterfaceType.tsym) {
  2826         if (a.annotationType.type.tsym == syms.functionalInterfaceType.tsym) {
  2827             if (s.kind != TYP) {
  2827             if (s.kind != TYP) {
  2828                 log.error(a.pos(), "bad.functional.intf.anno");
  2828                 log.error(a.pos(), "bad.functional.intf.anno");