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

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java (-1 / +3 lines)
Lines 8698-8704 Link Here
8698
		"");
8698
		"");
8699
}
8699
}
8700
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=258906 
8700
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=258906 
8701
public void _test265() {
8701
public void test265() {
8702
	if (new CompilerOptions(getCompilerOptions()).complianceLevel < ClassFileConstants.JDK1_6) return;
8703
8702
	INameEnvironment nameEnvironment = new FileSystem(Util.getJavaClassLibs(), new String[] {}, null);
8704
	INameEnvironment nameEnvironment = new FileSystem(Util.getJavaClassLibs(), new String[] {}, null);
8703
	IErrorHandlingPolicy errorHandlingPolicy = new IErrorHandlingPolicy() {
8705
	IErrorHandlingPolicy errorHandlingPolicy = new IErrorHandlingPolicy() {
8704
		public boolean proceedOnErrors() { return true; }
8706
		public boolean proceedOnErrors() { return true; }
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.java (-21 / +12 lines)
Lines 204-231 Link Here
204
204
205
	return null;
205
	return null;
206
}
206
}
207
207
public final boolean isViewedAsDeprecated() {
208
/**
208
	if ((this.tagBits & TagBits.DeprecatedAnnotationResolved) == 0) {
209
 * Compute the tagbits for standard annotations. For source types, these could require
209
		this.tagBits |= TagBits.DeprecatedAnnotationResolved;
210
 * lazily resolving corresponding annotation nodes, in case of forward references.
210
		if (this.compoundName != CharOperation.NO_CHAR_CHAR) {
211
 * @see org.eclipse.jdt.internal.compiler.lookup.Binding#getAnnotationTagBits()
211
			ReferenceBinding packageInfo = this.getType(TypeConstants.PACKAGE_INFO_NAME);
212
 * NOTE : when the name environment is based on the JavaModel, the synthetic
212
			if (packageInfo != null) {
213
 * package-info type is not stored so the package's annotations will not be available.
213
				packageInfo.initializeDeprecatedAnnotationTagBits();
214
 */
214
				this.tagBits |= packageInfo.tagBits & TagBits.AllStandardAnnotationsMask;
215
public long getAnnotationTagBits() {
215
			}
216
	if ((this.tagBits & TagBits.AnnotationResolved) != 0)
216
		}
217
		return this.tagBits;
217
	}
218
218
	return (this.tagBits & TagBits.AnnotationDeprecated) != 0;
219
	this.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
220
	if (this.compoundName == CharOperation.NO_CHAR_CHAR)
221
		return this.tagBits;
222
223
	ReferenceBinding packageInfo = this.getType(TypeConstants.PACKAGE_INFO_NAME);
224
	if (packageInfo != null)
225
		this.tagBits |= (packageInfo.getAnnotationTagBits() & TagBits.AllStandardAnnotationsMask);
226
	return this.tagBits;
227
}
219
}
228
229
/* API
220
/* API
230
* Answer the receiver's binding type from Binding.BindingID.
221
* Answer the receiver's binding type from Binding.BindingID.
231
*/
222
*/
(-)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().getAnnotationTagBits() & TagBits.AnnotationDeprecated) != 0;
1178
			|| getPackage().isViewedAsDeprecated();
1179
}
1179
}
1180
1180
1181
public ReferenceBinding[] memberTypes() {
1181
public ReferenceBinding[] memberTypes() {

Return to bug 263558