Index: compiler/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.java,v --- compiler/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.java 12 Jan 2009 18:37:16 -0000 1.49 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.java 9 Feb 2009 20:43:33 -0000 @@ -82,6 +82,39 @@ addPackage(subPackageBinding); return subPackageBinding; } +/** + * Compute the tagbits for standard annotations. For source types, these could require + * lazily resolving corresponding annotation nodes, in case of forward references. + * @see org.eclipse.jdt.internal.compiler.lookup.Binding#getAnnotationTagBits() + * NOTE : when the name environment is based on the JavaModel, the synthetic + * package-info type is not stored so the package's annotations will not be available. + */ +public long getAnnotationTagBits() { + if ((this.tagBits & TagBits.DeprecatedAnnotationResolved) != 0) + return this.tagBits; + + this.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved); + if (this.compoundName == CharOperation.NO_CHAR_CHAR) + return this.tagBits; + + ReferenceBinding packageInfo = this.getType(TypeConstants.PACKAGE_INFO_NAME); + if (packageInfo != null) + this.tagBits |= (packageInfo.getAnnotationTagBits() & TagBits.AllStandardAnnotationsMask); + return this.tagBits; +} +public long getDeprecatedAnnotationTagBits() { + if ((this.tagBits & TagBits.DeprecatedAnnotationResolved) != 0) + return this.tagBits; + + this.tagBits |= TagBits.DeprecatedAnnotationResolved; + if (this.compoundName == CharOperation.NO_CHAR_CHAR) + return this.tagBits; + + ReferenceBinding packageInfo = this.getType(TypeConstants.PACKAGE_INFO_NAME); + if (packageInfo != null) + packageInfo.initializeDeprecatedAnnotationTagBits(); + return this.tagBits; +} /* Answer the subpackage named name; ask the oracle for the package if its not in the cache. * Answer null if it could not be resolved. * @@ -204,28 +237,6 @@ return null; } - -/** - * Compute the tagbits for standard annotations. For source types, these could require - * lazily resolving corresponding annotation nodes, in case of forward references. - * @see org.eclipse.jdt.internal.compiler.lookup.Binding#getAnnotationTagBits() - * NOTE : when the name environment is based on the JavaModel, the synthetic - * package-info type is not stored so the package's annotations will not be available. - */ -public long getAnnotationTagBits() { - if ((this.tagBits & TagBits.AnnotationResolved) != 0) - return this.tagBits; - - this.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved); - if (this.compoundName == CharOperation.NO_CHAR_CHAR) - return this.tagBits; - - ReferenceBinding packageInfo = this.getType(TypeConstants.PACKAGE_INFO_NAME); - if (packageInfo != null) - this.tagBits |= (packageInfo.getAnnotationTagBits() & TagBits.AllStandardAnnotationsMask); - return this.tagBits; -} - /* API * Answer the receiver's binding type from Binding.BindingID. */ Index: compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java,v --- compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java 12 Jan 2009 18:37:16 -0000 1.129 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java 9 Feb 2009 20:43:33 -0000 @@ -1175,7 +1175,7 @@ */ public final boolean isViewedAsDeprecated() { return (this.modifiers & (ClassFileConstants.AccDeprecated | ExtraCompilerModifiers.AccDeprecatedImplicitly)) != 0 - || (getPackage().getAnnotationTagBits() & TagBits.AnnotationDeprecated) != 0; + || (getPackage().getDeprecatedAnnotationTagBits() & TagBits.AnnotationDeprecated) != 0; } public ReferenceBinding[] memberTypes() {