langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java
changeset 40313 a85f92c9a8ab
parent 39674 de3b0e52ca17
child 40504 0a01f6710c84
equal deleted inserted replaced
40312:4c7bf578577e 40313:a85f92c9a8ab
  3195             !syms.deprecatedType.isErroneous() &&
  3195             !syms.deprecatedType.isErroneous() &&
  3196             s.attribute(syms.deprecatedType.tsym) == null) {
  3196             s.attribute(syms.deprecatedType.tsym) == null) {
  3197             log.warning(LintCategory.DEP_ANN,
  3197             log.warning(LintCategory.DEP_ANN,
  3198                     pos, "missing.deprecated.annotation");
  3198                     pos, "missing.deprecated.annotation");
  3199         }
  3199         }
       
  3200         // Note: @Deprecated has no effect on local variables, parameters and package decls.
       
  3201         if (lint.isEnabled(LintCategory.DEPRECATION)) {
       
  3202             if (!syms.deprecatedType.isErroneous() && s.attribute(syms.deprecatedType.tsym) != null) {
       
  3203                 switch (s.getKind()) {
       
  3204                     case LOCAL_VARIABLE:
       
  3205                     case PACKAGE:
       
  3206                     case PARAMETER:
       
  3207                     case RESOURCE_VARIABLE:
       
  3208                     case EXCEPTION_PARAMETER:
       
  3209                         log.warning(LintCategory.DEPRECATION, pos,
       
  3210                                 "deprecated.annotation.has.no.effect", Kinds.kindName(s));
       
  3211                         break;
       
  3212                 }
       
  3213             }
       
  3214         }
  3200     }
  3215     }
  3201 
  3216 
  3202     void checkDeprecated(final DiagnosticPosition pos, final Symbol other, final Symbol s) {
  3217     void checkDeprecated(final DiagnosticPosition pos, final Symbol other, final Symbol s) {
  3203         if ((s.flags() & DEPRECATED) != 0 &&
  3218         if ((s.flags() & DEPRECATED) != 0 &&
  3204                 (other.flags() & DEPRECATED) == 0 &&
  3219                 (other.flags() & DEPRECATED) == 0 &&