View | Details | Raw Unified | Return to bug 214948 | Differences between
and this patch

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java (-4 lines)
Lines 493-502 Link Here
493
			syntheticTypeDeclaration.javadoc = new Javadoc(syntheticTypeDeclaration.declarationSourceStart, syntheticTypeDeclaration.declarationSourceStart);
493
			syntheticTypeDeclaration.javadoc = new Javadoc(syntheticTypeDeclaration.declarationSourceStart, syntheticTypeDeclaration.declarationSourceStart);
494
		}
494
		}
495
		syntheticTypeDeclaration.resolve(this.scope);
495
		syntheticTypeDeclaration.resolve(this.scope);
496
		// resolve annotations if any, skip this step if we don't have a valid scope due to an earlier error. (bug 252555)
497
		if (this.currentPackage!= null && this.currentPackage.annotations != null && syntheticTypeDeclaration.staticInitializerScope != null) {
498
			resolveAnnotations(syntheticTypeDeclaration.staticInitializerScope, this.currentPackage.annotations, this.scope.fPackage);
499
		}
500
		/*
496
		/*
501
		 * resolve javadoc package if any, skip this step if we don't have a valid scope due to an earlier error (bug 252555)
497
		 * resolve javadoc package if any, skip this step if we don't have a valid scope due to an earlier error (bug 252555)
502
		 * we do it now as the javadoc in the fake type won't be resolved. The peculiar usage of MethodScope to resolve the
498
		 * we do it now as the javadoc in the fake type won't be resolved. The peculiar usage of MethodScope to resolve the
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.java (+19 lines)
Lines 205-210 Link Here
205
	return null;
205
	return null;
206
}
206
}
207
207
208
/**
209
 * Compute the tagbits for standard annotations. For source types, these could require
210
 * lazily resolving corresponding annotation nodes, in case of forward references.
211
 * @see org.eclipse.jdt.internal.compiler.lookup.Binding#getAnnotationTagBits()
212
 */
213
public long getAnnotationTagBits() {
214
	if ((this.tagBits & TagBits.AnnotationResolved) != 0)
215
		return this.tagBits;
216
217
	this.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
218
	if (this.compoundName == CharOperation.NO_CHAR_CHAR)
219
		return this.tagBits;
220
221
	ReferenceBinding packageInfo = this.getType(TypeConstants.PACKAGE_INFO_NAME);
222
	if (packageInfo != null)
223
		this.tagBits |= (packageInfo.getAnnotationTagBits() & TagBits.AllStandardAnnotationsMask);
224
	return this.tagBits;
225
}
226
208
/* API
227
/* API
209
* Answer the receiver's binding type from Binding.BindingID.
228
* Answer the receiver's binding type from Binding.BindingID.
210
*/
229
*/
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java (-1 / +1 lines)
Lines 1175-1181 Link Here
1175
 */
1175
 */
1176
public final boolean isViewedAsDeprecated() {
1176
public final boolean isViewedAsDeprecated() {
1177
	return (this.modifiers & (ClassFileConstants.AccDeprecated | ExtraCompilerModifiers.AccDeprecatedImplicitly)) != 0
1177
	return (this.modifiers & (ClassFileConstants.AccDeprecated | ExtraCompilerModifiers.AccDeprecatedImplicitly)) != 0
1178
			|| (getPackage().tagBits & TagBits.AnnotationDeprecated) != 0;
1178
			|| (getPackage().getAnnotationTagBits() & TagBits.AnnotationDeprecated) != 0;
1179
}
1179
}
1180
1180
1181
public ReferenceBinding[] memberTypes() {
1181
public ReferenceBinding[] memberTypes() {
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java (-8 / +7 lines)
Lines 2809-2824 Link Here
2809
					MethodBinding context = ((AbstractMethodDeclaration)methodScope.referenceContext).binding;
2809
					MethodBinding context = ((AbstractMethodDeclaration)methodScope.referenceContext).binding;
2810
					if (context != null && context.isViewedAsDeprecated())
2810
					if (context != null && context.isViewedAsDeprecated())
2811
						return true;
2811
						return true;
2812
				} else {
2812
				} else if (methodScope.initializedField != null && methodScope.initializedField.isViewedAsDeprecated()) {
2813
					SourceTypeBinding type = ((BlockScope)this).referenceType().binding;
2814
					// inside field declaration ? check field modifier to see if deprecated
2813
					// inside field declaration ? check field modifier to see if deprecated
2815
					if (methodScope.initializedField != null && methodScope.initializedField.isViewedAsDeprecated())
2814
					return true;
2815
				}
2816
				SourceTypeBinding declaringType = ((BlockScope)this).referenceType().binding;
2817
				if (declaringType != null) {
2818
					declaringType.initializeDeprecatedAnnotationTagBits(); // may not have been resolved until then
2819
					if (declaringType.isViewedAsDeprecated())
2816
						return true;
2820
						return true;
2817
					if (type != null) {
2818
						type.initializeDeprecatedAnnotationTagBits(); // may not have been resolved until then
2819
						if (type.isViewedAsDeprecated())
2820
							return true;
2821
					}
2822
				}
2821
				}
2823
				break;
2822
				break;
2824
			case Scope.CLASS_SCOPE :
2823
			case Scope.CLASS_SCOPE :

Return to bug 214948