List of usage examples for org.eclipse.jdt.internal.compiler.lookup FieldBinding isDeprecated
public final boolean isDeprecated()
From source file:org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.java
License:Open Source License
public FieldBinding resolveTypeFor(FieldBinding field) { if ((field.modifiers & ExtraCompilerModifiers.AccUnresolved) == 0) return field; if (this.scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) { if ((field.getAnnotationTagBits() & TagBits.AnnotationDeprecated) != 0) field.modifiers |= ClassFileConstants.AccDeprecated; }/* www . j a v a2 s. c o m*/ if (isViewedAsDeprecated() && !field.isDeprecated()) field.modifiers |= ExtraCompilerModifiers.AccDeprecatedImplicitly; if (hasRestrictedAccess()) field.modifiers |= ExtraCompilerModifiers.AccRestrictedAccess; FieldDeclaration[] fieldDecls = this.scope.referenceContext.fields; int length = fieldDecls == null ? 0 : fieldDecls.length; for (int f = 0; f < length; f++) { if (fieldDecls[f].binding != field) continue; MethodScope initializationScope = field.isStatic() ? this.scope.referenceContext.staticInitializerScope : this.scope.referenceContext.initializerScope; FieldBinding previousField = initializationScope.initializedField; try { initializationScope.initializedField = field; FieldDeclaration fieldDecl = fieldDecls[f]; TypeBinding fieldType = fieldDecl.getKind() == AbstractVariableDeclaration.ENUM_CONSTANT ? initializationScope.environment().convertToRawType(this, false /*do not force conversion of enclosing types*/) // enum constant is implicitly of declaring enum type : fieldDecl.type.resolveType(initializationScope, true /* check bounds*/); field.type = fieldType; field.modifiers &= ~ExtraCompilerModifiers.AccUnresolved; if (fieldType == null) { fieldDecl.binding = null; return null; } if (fieldType == TypeBinding.VOID) { this.scope.problemReporter().variableTypeCannotBeVoid(fieldDecl); fieldDecl.binding = null; return null; } if (fieldType.isArrayType() && ((ArrayBinding) fieldType).leafComponentType == TypeBinding.VOID) { this.scope.problemReporter().variableTypeCannotBeVoidArray(fieldDecl); fieldDecl.binding = null; return null; } if ((fieldType.tagBits & TagBits.HasMissingType) != 0) { field.tagBits |= TagBits.HasMissingType; } TypeBinding leafType = fieldType.leafComponentType(); if (leafType instanceof ReferenceBinding && (((ReferenceBinding) leafType).modifiers & ExtraCompilerModifiers.AccGenericSignature) != 0) { field.modifiers |= ExtraCompilerModifiers.AccGenericSignature; } } finally { initializationScope.initializedField = previousField; } return field; } return null; // should never reach this point }