### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.java,v retrieving revision 1.14 diff -u -r1.14 SyntheticMethodBinding.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.java 12 Oct 2006 17:57:21 -0000 1.14 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.java 19 Oct 2006 09:44:34 -0000 @@ -40,7 +40,7 @@ public SyntheticMethodBinding(FieldBinding targetField, boolean isReadAccess, ReferenceBinding declaringClass) { this.modifiers = ClassFileConstants.AccDefault | ClassFileConstants.AccStatic | ClassFileConstants.AccSynthetic; - this.tagBits |= TagBits.AnnotationResolved; + this.tagBits |= TagBits.AnnotationResolvedMASK; SourceTypeBinding declaringSourceType = (SourceTypeBinding) declaringClass; SyntheticMethodBinding[] knownAccessMethods = declaringSourceType.syntheticMethods(); int methodId = knownAccessMethods == null ? 0 : knownAccessMethods.length; @@ -144,7 +144,7 @@ public SyntheticMethodBinding(FieldBinding targetField, ReferenceBinding declaringClass, TypeBinding enumBinding, char[] selector) { this.modifiers = ClassFileConstants.AccDefault | ClassFileConstants.AccStatic | ClassFileConstants.AccSynthetic; - this.tagBits |= TagBits.AnnotationResolved; + this.tagBits |= TagBits.AnnotationResolvedMASK; SourceTypeBinding declaringSourceType = (SourceTypeBinding) declaringClass; SyntheticMethodBinding[] knownAccessMethods = declaringSourceType.syntheticMethods(); int methodId = knownAccessMethods == null ? 0 : knownAccessMethods.length; @@ -225,7 +225,7 @@ // amongst other, clear the AccGenericSignature, so as to ensure no remains of original inherited persist (101794) // also use the modifiers from the target method, as opposed to inherited one (147690) this.modifiers = (targetMethod.modifiers | ClassFileConstants.AccBridge | ClassFileConstants.AccSynthetic) & ~(ClassFileConstants.AccAbstract | ClassFileConstants.AccNative | ClassFileConstants.AccFinal | ExtraCompilerModifiers.AccGenericSignature); - this.tagBits |= TagBits.AnnotationResolved; + this.tagBits |= TagBits.AnnotationResolvedMASK; this.returnType = overridenMethodToBridge.returnType; this.parameters = overridenMethodToBridge.parameters; this.thrownExceptions = overridenMethodToBridge.thrownExceptions; @@ -243,7 +243,7 @@ this.declaringClass = declaringEnum; this.selector = selector; this.modifiers = ClassFileConstants.AccPublic | ClassFileConstants.AccStatic; - this.tagBits |= TagBits.AnnotationResolved; + this.tagBits |= TagBits.AnnotationResolvedMASK; this.thrownExceptions = Binding.NO_EXCEPTIONS; if (selector == TypeConstants.VALUES) { this.returnType = declaringEnum.scope.createArrayType(declaringEnum, 1); @@ -270,7 +270,7 @@ this.targetMethod = accessedConstructor; this.modifiers = ClassFileConstants.AccDefault | ClassFileConstants.AccSynthetic; - this.tagBits |= TagBits.AnnotationResolved; + this.tagBits |= TagBits.AnnotationResolvedMASK; SourceTypeBinding sourceType = (SourceTypeBinding) accessedConstructor.declaringClass; SyntheticMethodBinding[] knownSyntheticMethods = sourceType.syntheticMethods(); @@ -350,7 +350,7 @@ this.targetMethod = accessedMethod; this.modifiers = ClassFileConstants.AccDefault | ClassFileConstants.AccStatic | ClassFileConstants.AccSynthetic; - this.tagBits |= TagBits.AnnotationResolved; + this.tagBits |= TagBits.AnnotationResolvedMASK; SourceTypeBinding declaringSourceType = (SourceTypeBinding) receiverType; SyntheticMethodBinding[] knownAccessMethods = declaringSourceType.syntheticMethods(); int methodId = knownAccessMethods == null ? 0 : knownAccessMethods.length; Index: compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java,v retrieving revision 1.138 diff -u -r1.138 SourceTypeBinding.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java 9 Jun 2006 10:20:47 -0000 1.138 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java 19 Oct 2006 09:44:33 -0000 @@ -969,23 +969,23 @@ } /** - * Compute the tagbits for @Deprecated annotations; avoiding resolving - * entire annotation if not necessary. * @see org.eclipse.jdt.internal.compiler.lookup.Binding#initializeDeprecatedAnnotationTagBits() */ public void initializeDeprecatedAnnotationTagBits() { - if ((this.tagBits & (TagBits.AnnotationResolved|TagBits.AnnotationDeprecated)) == 0) { - TypeDeclaration typeDecl = this.scope.referenceContext; - boolean old = typeDecl.staticInitializerScope.insideTypeAnnotation; - try { - typeDecl.staticInitializerScope.insideTypeAnnotation = true; - ASTNode.resolveDeprecatedAnnotations(typeDecl.staticInitializerScope, typeDecl.annotations, this); - } finally { - typeDecl.staticInitializerScope.insideTypeAnnotation = old; - } - if ((this.tagBits & TagBits.AnnotationDeprecated) != 0) - this.modifiers |= ClassFileConstants.AccDeprecated; +// if ((this.tagBits & TagBits.DeprecatedAnnotationResolved) == 0) { + // guard at calling point to save calls + TypeDeclaration typeDecl = this.scope.referenceContext; + boolean old = typeDecl.staticInitializerScope.insideTypeAnnotation; + try { + typeDecl.staticInitializerScope.insideTypeAnnotation = true; + ASTNode.resolveDeprecatedAnnotations(typeDecl.staticInitializerScope, typeDecl.annotations, this); + } finally { + typeDecl.staticInitializerScope.insideTypeAnnotation = old; } + if ((this.tagBits & TagBits.AnnotationDeprecated) != 0) + this.modifiers |= ClassFileConstants.AccDeprecated; + this.tagBits |= TagBits.DeprecatedAnnotationResolved; +// } } /** Index: compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticFieldBinding.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticFieldBinding.java,v retrieving revision 1.10 diff -u -r1.10 SyntheticFieldBinding.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticFieldBinding.java 10 May 2006 18:03:50 -0000 1.10 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticFieldBinding.java 19 Oct 2006 09:44:33 -0000 @@ -19,6 +19,6 @@ public SyntheticFieldBinding(char[] name, TypeBinding type, int modifiers, ReferenceBinding declaringClass, Constant constant, int index) { super(name, type, modifiers, declaringClass, constant); this.index = index; - this.tagBits |= TagBits.AnnotationResolved; + this.tagBits |= TagBits.AnnotationResolvedMASK; } } Index: compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java,v retrieving revision 1.27 diff -u -r1.27 TagBits.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java 25 Apr 2006 19:36:31 -0000 1.27 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java 19 Oct 2006 09:44:34 -0000 @@ -77,6 +77,9 @@ // standard annotations // 9-bits for targets long AnnotationResolved = ASTNode.Bit34L; + long DeprecatedAnnotationResolved = ASTNode.Bit52L; + long AnnotationResolvedMASK = AnnotationResolved | DeprecatedAnnotationResolved; + // should have AnnotationsResolved => DeprecatedAnnotationResolved long AnnotationTarget = ASTNode.Bit35L; // @Target({}) only sets this bit long AnnotationForType = ASTNode.Bit36L; long AnnotationForField = ASTNode.Bit37L; @@ -105,4 +108,5 @@ long AllStandardAnnotationsMask = AnnotationTargetMASK | AnnotationRetentionMASK | AnnotationDeprecated | AnnotationDocumented | AnnotationInherited | AnnotationOverride | AnnotationSuppressWarnings; long DefaultValueResolved = ASTNode.Bit51L; + // 52L used above } Index: compiler/org/eclipse/jdt/internal/compiler/lookup/FieldBinding.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/FieldBinding.java,v retrieving revision 1.46 diff -u -r1.46 FieldBinding.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/FieldBinding.java 29 Mar 2006 02:45:27 -0000 1.46 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/FieldBinding.java 19 Oct 2006 09:44:21 -0000 @@ -237,7 +237,7 @@ if ((originalField.tagBits & TagBits.AnnotationResolved) == 0 && originalField.declaringClass instanceof SourceTypeBinding) { ClassScope scope = ((SourceTypeBinding) originalField.declaringClass).scope; if (scope == null) { // synthetic fields do not have a scope nor any annotations - this.tagBits |= TagBits.AnnotationResolved; + this.tagBits |= TagBits.AnnotationResolvedMASK; return 0; } TypeDeclaration typeDecl = scope.referenceContext; Index: compiler/org/eclipse/jdt/internal/compiler/lookup/MemberTypeBinding.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MemberTypeBinding.java,v retrieving revision 1.21 diff -u -r1.21 MemberTypeBinding.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/MemberTypeBinding.java 16 Oct 2006 08:07:14 -0000 1.21 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/MemberTypeBinding.java 19 Oct 2006 09:44:21 -0000 @@ -11,9 +11,6 @@ package org.eclipse.jdt.internal.compiler.lookup; import org.eclipse.jdt.core.compiler.CharOperation; -import org.eclipse.jdt.internal.compiler.ast.ASTNode; -import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration; -import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; public final class MemberTypeBinding extends NestedTypeBinding { public MemberTypeBinding(char[][] compoundName, ClassScope scope, SourceTypeBinding enclosingType) { @@ -36,25 +33,25 @@ return constantPoolName = CharOperation.concat(enclosingType().constantPoolName(), sourceName, '$'); } + +/** + * @see org.eclipse.jdt.internal.compiler.lookup.Binding#initializeDeprecatedAnnotationTagBits() + */ public void initializeDeprecatedAnnotationTagBits() { - if ((this.tagBits & (TagBits.AnnotationResolved|TagBits.AnnotationDeprecated)) == 0) { - ReferenceBinding enclosing = this.enclosingType(); - enclosing.initializeDeprecatedAnnotationTagBits(); - TypeDeclaration typeDecl = this.scope.referenceContext; - boolean old = typeDecl.staticInitializerScope.insideTypeAnnotation; - try { - typeDecl.staticInitializerScope.insideTypeAnnotation = true; - ASTNode.resolveDeprecatedAnnotations(typeDecl.staticInitializerScope, typeDecl.annotations, this); - } finally { - typeDecl.staticInitializerScope.insideTypeAnnotation = old; +// if ((this.tagBits & TagBits.DeprecatedAnnotationResolved) == 0) { + // guard at calling point to save calls + super.initializeDeprecatedAnnotationTagBits(); + if ((this.tagBits & TagBits.AnnotationDeprecated) == 0) { + // check enclosing type + ReferenceBinding enclosing; + if (((enclosing = this.enclosingType()).tagBits & TagBits.DeprecatedAnnotationResolved) == 0) { + enclosing.initializeDeprecatedAnnotationTagBits(); } - if ((this.tagBits & TagBits.AnnotationDeprecated) != 0) { - this.modifiers |= ClassFileConstants.AccDeprecated; - } else if ((enclosing.modifiers & (ClassFileConstants.AccDeprecated | - ExtraCompilerModifiers.AccDeprecatedImplicitly)) != 0) { + if (enclosing.isViewedAsDeprecated()) { this.modifiers |= ExtraCompilerModifiers.AccDeprecatedImplicitly; } } +// } } public String toString() { return "Member type : " + new String(sourceName()) + " " + super.toString(); //$NON-NLS-2$ //$NON-NLS-1$ Index: compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java,v retrieving revision 1.286 diff -u -r1.286 Scope.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 9 Oct 2006 17:28:54 -0000 1.286 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 19 Oct 2006 09:44:29 -0000 @@ -2642,7 +2642,9 @@ if (methodScope.initializedField != null && methodScope.initializedField.isViewedAsDeprecated()) return true; if (type != null) { - type.initializeDeprecatedAnnotationTagBits(); // may not have been resolved until then + if ((type.tagBits & TagBits.DeprecatedAnnotationResolved) == 0) { + type.initializeDeprecatedAnnotationTagBits(); // may not have been resolved until then + } if (type.isViewedAsDeprecated()) return true; } @@ -2651,7 +2653,9 @@ case Scope.CLASS_SCOPE : ReferenceBinding context = ((ClassScope)this).referenceType().binding; if (context != null) { - context.initializeDeprecatedAnnotationTagBits(); // may not have been resolved until then + if ((context.tagBits & TagBits.DeprecatedAnnotationResolved) == 0) { + context.initializeDeprecatedAnnotationTagBits(); // may not have been resolved until then + } if (context.isViewedAsDeprecated()) return true; } @@ -2662,7 +2666,9 @@ if (unit.types != null && unit.types.length > 0) { SourceTypeBinding type = unit.types[0].binding; if (type != null) { - type.initializeDeprecatedAnnotationTagBits(); // may not have been resolved until then + if ((type.tagBits & TagBits.DeprecatedAnnotationResolved) == 0) { + type.initializeDeprecatedAnnotationTagBits(); // may not have been resolved until then + } if (type.isViewedAsDeprecated()) return true; } Index: compiler/org/eclipse/jdt/internal/compiler/lookup/Binding.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Binding.java,v retrieving revision 1.27 diff -u -r1.27 Binding.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/Binding.java 29 Mar 2006 02:40:11 -0000 1.27 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/Binding.java 19 Oct 2006 09:44:17 -0000 @@ -72,8 +72,10 @@ } /** - * Compute the tagbits for @Deprecated annotations; avoiding resolving - * entire annotation if not necessary. + * Compute the tag bits for @Deprecated annotations, avoiding resolving + * entire annotation if not necessary. The caller should guard against + * multiple calls by testing against the DeprecatedAnnotationResolved tag + * bit. * @see org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding#initializeDeprecatedAnnotationTagBits() */ public void initializeDeprecatedAnnotationTagBits() { Index: compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java,v retrieving revision 1.140 diff -u -r1.140 ClassScope.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java 8 Sep 2006 13:36:02 -0000 1.140 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java 19 Oct 2006 09:44:19 -0000 @@ -358,6 +358,8 @@ else modifiers |= ClassFileConstants.AccStatic; } + if (enclosingType.isViewedAsDeprecated() && !sourceType.isDeprecated()) + modifiers |= ExtraCompilerModifiers.AccDeprecatedImplicitly; } else if (sourceType.isLocalType()) { if (sourceType.isEnum()) { problemReporter().illegalLocalTypeDeclaration(referenceContext); Index: compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java,v retrieving revision 1.75 diff -u -r1.75 ASTNode.java --- compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java 18 Oct 2006 19:09:55 -0000 1.75 +++ compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java 19 Oct 2006 09:44:15 -0000 @@ -409,7 +409,9 @@ } // force annotations resolution before deciding whether the type may be deprecated - refType.initializeDeprecatedAnnotationTagBits(); + if ((refType.tagBits & TagBits.DeprecatedAnnotationResolved) == 0) { + refType.initializeDeprecatedAnnotationTagBits(); + } if (!refType.isViewedAsDeprecated()) return false; @@ -475,13 +477,13 @@ case Binding.PACKAGE : PackageBinding packageBinding = (PackageBinding) recipient; if ((packageBinding.tagBits & TagBits.AnnotationResolved) != 0) return; - packageBinding.tagBits |= TagBits.AnnotationResolved; + packageBinding.tagBits |= TagBits.AnnotationResolvedMASK; break; case Binding.TYPE : case Binding.GENERIC_TYPE : ReferenceBinding type = (ReferenceBinding) recipient; if ((type.tagBits & TagBits.AnnotationResolved) != 0) return; - type.tagBits |= TagBits.AnnotationResolved; + type.tagBits |= TagBits.AnnotationResolvedMASK; if (length > 0) { instances = new AnnotationBinding[length]; type.setAnnotations(instances); @@ -490,7 +492,7 @@ case Binding.METHOD : MethodBinding method = (MethodBinding) recipient; if ((method.tagBits & TagBits.AnnotationResolved) != 0) return; - method.tagBits |= TagBits.AnnotationResolved; + method.tagBits |= TagBits.AnnotationResolvedMASK; if (length > 0) { instances = new AnnotationBinding[length]; method.setAnnotations(instances); @@ -499,7 +501,7 @@ case Binding.FIELD : FieldBinding field = (FieldBinding) recipient; if ((field.tagBits & TagBits.AnnotationResolved) != 0) return; - field.tagBits |= TagBits.AnnotationResolved; + field.tagBits |= TagBits.AnnotationResolvedMASK; if (length > 0) { instances = new AnnotationBinding[length]; field.setAnnotations(instances); @@ -508,7 +510,7 @@ case Binding.LOCAL : LocalVariableBinding local = (LocalVariableBinding) recipient; if ((local.tagBits & TagBits.AnnotationResolved) != 0) return; - local.tagBits |= TagBits.AnnotationResolved; + local.tagBits |= TagBits.AnnotationResolvedMASK; if (length > 0) { instances = new AnnotationBinding[length]; local.setAnnotations(instances); @@ -548,77 +550,104 @@ } } - /** - * Figures if @Deprecated annotation is specified, do not resolve entire annotations. - */ - public static void resolveDeprecatedAnnotations(BlockScope scope, Annotation[] annotations, Binding recipient) { - if (annotations == null) - return; - int length = annotations.length; - if (length == 0) - return; - if (recipient != null) { - switch (recipient.kind()) { - case Binding.PACKAGE : - PackageBinding packageBinding = (PackageBinding) recipient; - if ((packageBinding.tagBits & (TagBits.AnnotationResolved|TagBits.AnnotationDeprecated)) != 0) return; - break; - case Binding.TYPE : - case Binding.GENERIC_TYPE : - ReferenceBinding type = (ReferenceBinding) recipient; - if ((type.tagBits & (TagBits.AnnotationResolved|TagBits.AnnotationDeprecated)) != 0) return; - break; - case Binding.METHOD : - MethodBinding method = (MethodBinding) recipient; - if ((method.tagBits & (TagBits.AnnotationResolved|TagBits.AnnotationDeprecated)) != 0) return; - break; - case Binding.FIELD : - FieldBinding field = (FieldBinding) recipient; - if ((field.tagBits & (TagBits.AnnotationResolved|TagBits.AnnotationDeprecated)) != 0) return; - break; - case Binding.LOCAL : - LocalVariableBinding local = (LocalVariableBinding) recipient; - if ((local.tagBits & (TagBits.AnnotationResolved|TagBits.AnnotationDeprecated)) != 0) return; - break; - default : - return; - } - } - for (int i = 0; i < length; i++) { - TypeReference annotationTypeRef = annotations[i].type; - // only resolve type name if 'Deprecated' last token - if (!CharOperation.equals(TypeConstants.JAVA_LANG_DEPRECATED[2], annotationTypeRef.getLastToken())) return; - TypeBinding annotationType = annotations[i].type.resolveType(scope); - if(annotationType != null && annotationType.isValidBinding() && annotationType.id == TypeIds.T_JavaLangDeprecated) { - if (recipient != null) { - switch (recipient.kind()) { - case Binding.PACKAGE : - PackageBinding packageBinding = (PackageBinding) recipient; - packageBinding.tagBits |= TagBits.AnnotationDeprecated; - break; - case Binding.TYPE : - case Binding.GENERIC_TYPE : - case Binding.TYPE_PARAMETER : - ReferenceBinding type = (ReferenceBinding) recipient; - type.tagBits |= TagBits.AnnotationDeprecated; - break; - case Binding.METHOD : - MethodBinding method = (MethodBinding) recipient; - method.tagBits |= TagBits.AnnotationDeprecated; - break; - case Binding.FIELD : - FieldBinding field = (FieldBinding) recipient; - field.tagBits |= TagBits.AnnotationDeprecated; - break; - case Binding.LOCAL : - LocalVariableBinding local = (LocalVariableBinding) recipient; - local.tagBits |= TagBits.AnnotationDeprecated; - break; - } +/** + * Figures if @Deprecated annotation is specified, do not resolve entire annotations. + */ +public static void resolveDeprecatedAnnotations(BlockScope scope, Annotation[] annotations, Binding recipient) { + if (recipient != null) { + int kind = recipient.kind(); + if (annotations != null) { + int length; + if ((length = annotations.length) >= 0) { + switch (kind) { + case Binding.PACKAGE : + PackageBinding packageBinding = (PackageBinding) recipient; + if ((packageBinding.tagBits & TagBits.DeprecatedAnnotationResolved) != 0) return; + break; + case Binding.TYPE : + case Binding.GENERIC_TYPE : + ReferenceBinding type = (ReferenceBinding) recipient; + if ((type.tagBits & TagBits.DeprecatedAnnotationResolved) != 0) return; + break; + case Binding.METHOD : + MethodBinding method = (MethodBinding) recipient; + if ((method.tagBits & TagBits.DeprecatedAnnotationResolved) != 0) return; + break; + case Binding.FIELD : + FieldBinding field = (FieldBinding) recipient; + if ((field.tagBits & TagBits.DeprecatedAnnotationResolved) != 0) return; + break; + case Binding.LOCAL : + LocalVariableBinding local = (LocalVariableBinding) recipient; + if ((local.tagBits & TagBits.DeprecatedAnnotationResolved) != 0) return; + break; + default : + return; + } + for (int i = 0; i < length; i++) { + TypeReference annotationTypeRef = annotations[i].type; + // only resolve type name if 'Deprecated' last token + if (!CharOperation.equals(TypeConstants.JAVA_LANG_DEPRECATED[2], annotationTypeRef.getLastToken())) return; + TypeBinding annotationType = annotations[i].type.resolveType(scope); + if(annotationType != null && annotationType.isValidBinding() && annotationType.id == TypeIds.T_JavaLangDeprecated) { + switch (kind) { + case Binding.PACKAGE : + PackageBinding packageBinding = (PackageBinding) recipient; + packageBinding.tagBits |= (TagBits.AnnotationDeprecated | TagBits.DeprecatedAnnotationResolved); + return; + case Binding.TYPE : + case Binding.GENERIC_TYPE : + case Binding.TYPE_PARAMETER : + ReferenceBinding type = (ReferenceBinding) recipient; + type.tagBits |= (TagBits.AnnotationDeprecated | TagBits.DeprecatedAnnotationResolved); + return; + case Binding.METHOD : + MethodBinding method = (MethodBinding) recipient; + method.tagBits |= (TagBits.AnnotationDeprecated | TagBits.DeprecatedAnnotationResolved); + return; + case Binding.FIELD : + FieldBinding field = (FieldBinding) recipient; + field.tagBits |= (TagBits.AnnotationDeprecated | TagBits.DeprecatedAnnotationResolved); + return; + case Binding.LOCAL : + LocalVariableBinding local = (LocalVariableBinding) recipient; + local.tagBits |= (TagBits.AnnotationDeprecated | TagBits.DeprecatedAnnotationResolved); + return; + default: + return; + } + } } } } + switch (kind) { + case Binding.PACKAGE : + PackageBinding packageBinding = (PackageBinding) recipient; + packageBinding.tagBits |= TagBits.DeprecatedAnnotationResolved; + return; + case Binding.TYPE : + case Binding.GENERIC_TYPE : + case Binding.TYPE_PARAMETER : + ReferenceBinding type = (ReferenceBinding) recipient; + type.tagBits |= TagBits.DeprecatedAnnotationResolved; + return; + case Binding.METHOD : + MethodBinding method = (MethodBinding) recipient; + method.tagBits |= TagBits.DeprecatedAnnotationResolved; + return; + case Binding.FIELD : + FieldBinding field = (FieldBinding) recipient; + field.tagBits |= TagBits.DeprecatedAnnotationResolved; + return; + case Binding.LOCAL : + LocalVariableBinding local = (LocalVariableBinding) recipient; + local.tagBits |= TagBits.DeprecatedAnnotationResolved; + return; + default: + return; + } } +} public int sourceStart() { return this.sourceStart;