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 && |