@Override public boolean isAnnotation() { return this.binding.isAnnotationType(); }
public boolean isAnnotation() { return this.binding.isAnnotationType(); }
public boolean isAnnotation() { return this.binding.isAnnotationType(); }
public boolean isAnnotation() { return this.binding.isAnnotationType(); }
public boolean isAnnotation() { return this.binding.isAnnotationType(); }
public boolean isAnnotation() { return this.binding.isAnnotationType(); }
public IAnnotationBinding[] getAnnotations() { if (this.prototype != null) { return this.prototype.getAnnotations(); } if (this.annotations != null) { return this.annotations; } org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding refType = null; if (this.binding instanceof ParameterizedTypeBinding) { refType = ((ParameterizedTypeBinding) this.binding).genericType(); } else if (this.binding.isAnnotationType() || this.binding.isClass() || this.binding.isEnum() || this.binding.isInterface()) { refType = (org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding) this.binding; } if (refType != null) { return this.annotations = resolveAnnotationBindings(refType.getAnnotations(), false); } return this.annotations = AnnotationBinding.NoAnnotations; } private IAnnotationBinding[] resolveAnnotationBindings(org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding[] internalAnnotations, boolean isTypeUse) {
public IAnnotationBinding[] getAnnotations() { if (this.prototype != null) { return this.prototype.getAnnotations(); } if (this.annotations != null) { return this.annotations; } org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding refType = null; if (this.binding instanceof ParameterizedTypeBinding) { refType = ((ParameterizedTypeBinding) this.binding).genericType(); } else if (this.binding.isAnnotationType() || this.binding.isClass() || this.binding.isEnum() || this.binding.isInterface()) { refType = (org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding) this.binding; } if (refType != null) { return this.annotations = resolveAnnotationBindings(refType.getAnnotations(), false); } return this.annotations = AnnotationBinding.NoAnnotations; } private IAnnotationBinding[] resolveAnnotationBindings(org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding[] internalAnnotations, boolean isTypeUse) {
@Override public IAnnotationBinding[] getAnnotations() { if (this.prototype != null) { return this.prototype.getAnnotations(); } if (this.annotations != null) { return this.annotations; } org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding refType = null; if (this.binding instanceof ParameterizedTypeBinding) { refType = ((ParameterizedTypeBinding) this.binding).genericType(); } else if (this.binding.isAnnotationType() || this.binding.isClass() || this.binding.isEnum() || this.binding.isInterface()) { refType = (org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding) this.binding; } if (refType != null) { return this.annotations = resolveAnnotationBindings(refType.getAnnotations(), false); } return this.annotations = AnnotationBinding.NoAnnotations; } private IAnnotationBinding[] resolveAnnotationBindings(org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding[] internalAnnotations, boolean isTypeUse) {
public IAnnotationBinding[] getAnnotations() { if (this.prototype != null) { return this.prototype.getAnnotations(); } if (this.annotations != null) { return this.annotations; } org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding refType = null; if (this.binding instanceof ParameterizedTypeBinding) { refType = ((ParameterizedTypeBinding) this.binding).genericType(); } else if (this.binding.isAnnotationType() || this.binding.isClass() || this.binding.isEnum() || this.binding.isInterface()) { refType = (org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding) this.binding; } if (refType != null) { return this.annotations = resolveAnnotationBindings(refType.getAnnotations(), false); } return this.annotations = AnnotationBinding.NoAnnotations; } private IAnnotationBinding[] resolveAnnotationBindings(org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding[] internalAnnotations, boolean isTypeUse) {
public IAnnotationBinding[] getAnnotations() { if (this.prototype != null) { return this.prototype.getAnnotations(); } if (this.annotations != null) { return this.annotations; } org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding refType = null; if (this.binding instanceof ParameterizedTypeBinding) { refType = ((ParameterizedTypeBinding) this.binding).genericType(); } else if (this.binding.isAnnotationType() || this.binding.isClass() || this.binding.isEnum() || this.binding.isInterface()) { refType = (org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding) this.binding; } if (refType != null) { return this.annotations = resolveAnnotationBindings(refType.getAnnotations(), false); } return this.annotations = AnnotationBinding.NoAnnotations; } private IAnnotationBinding[] resolveAnnotationBindings(org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding[] internalAnnotations, boolean isTypeUse) {
@Override public void run() { if (!(MemberValuePair.this.value.isConstantValueOfTypeAssignableToType(valueType, requiredType) || valueType.isCompatibleWith(requiredType))) { if (!(requiredType.isArrayType() && requiredType.dimensions() == 1 && (MemberValuePair.this.value.isConstantValueOfTypeAssignableToType(valueType, leafType) || valueType.isCompatibleWith(leafType)))) { if (leafType.isAnnotationType() && !valueType.isAnnotationType()) { scope.problemReporter().annotationValueMustBeAnnotation(MemberValuePair.this.binding.declaringClass, MemberValuePair.this.name, MemberValuePair.this.value, leafType); } else { scope.problemReporter().typeMismatchError(valueType, requiredType, MemberValuePair.this.value, null); } shouldExit[0] = true; // TODO may allow to proceed to find more errors at once } } else { scope.compilationUnitScope().recordTypeConversion(requiredType.leafComponentType(), valueType.leafComponentType()); MemberValuePair.this.value.computeConversion(scope, requiredType, valueType); } } };
@Override public void run() { if (!(MemberValuePair.this.value.isConstantValueOfTypeAssignableToType(valueType, requiredType) || valueType.isCompatibleWith(requiredType))) { if (!(requiredType.isArrayType() && requiredType.dimensions() == 1 && (MemberValuePair.this.value.isConstantValueOfTypeAssignableToType(valueType, leafType) || valueType.isCompatibleWith(leafType)))) { if (leafType.isAnnotationType() && !valueType.isAnnotationType()) { scope.problemReporter().annotationValueMustBeAnnotation(MemberValuePair.this.binding.declaringClass, MemberValuePair.this.name, MemberValuePair.this.value, leafType); } else { scope.problemReporter().typeMismatchError(valueType, requiredType, MemberValuePair.this.value, null); } shouldExit[0] = true; // TODO may allow to proceed to find more errors at once } } else { scope.compilationUnitScope().recordTypeConversion(requiredType.leafComponentType(), valueType.leafComponentType()); MemberValuePair.this.value.computeConversion(scope, requiredType, valueType); } } };
@Override public void run() { if (!(MemberValuePair.this.value.isConstantValueOfTypeAssignableToType(valueType, requiredType) || valueType.isCompatibleWith(requiredType))) { if (!(requiredType.isArrayType() && requiredType.dimensions() == 1 && (MemberValuePair.this.value.isConstantValueOfTypeAssignableToType(valueType, leafType) || valueType.isCompatibleWith(leafType)))) { if (leafType.isAnnotationType() && !valueType.isAnnotationType()) { scope.problemReporter().annotationValueMustBeAnnotation(MemberValuePair.this.binding.declaringClass, MemberValuePair.this.name, MemberValuePair.this.value, leafType); } else { scope.problemReporter().typeMismatchError(valueType, requiredType, MemberValuePair.this.value, null); } shouldExit[0] = true; // TODO may allow to proceed to find more errors at once } } else { scope.compilationUnitScope().recordTypeConversion(requiredType.leafComponentType(), valueType.leafComponentType()); MemberValuePair.this.value.computeConversion(scope, requiredType, valueType); } } };
@Override public void run() { if (!(MemberValuePair.this.value.isConstantValueOfTypeAssignableToType(valueType, requiredType) || valueType.isCompatibleWith(requiredType))) { if (!(requiredType.isArrayType() && requiredType.dimensions() == 1 && (MemberValuePair.this.value.isConstantValueOfTypeAssignableToType(valueType, leafType) || valueType.isCompatibleWith(leafType)))) { if (leafType.isAnnotationType() && !valueType.isAnnotationType()) { scope.problemReporter().annotationValueMustBeAnnotation(MemberValuePair.this.binding.declaringClass, MemberValuePair.this.name, MemberValuePair.this.value, leafType); } else { scope.problemReporter().typeMismatchError(valueType, requiredType, MemberValuePair.this.value, null); } shouldExit[0] = true; // TODO may allow to proceed to find more errors at once } } else { scope.compilationUnitScope().recordTypeConversion(requiredType.leafComponentType(), valueType.leafComponentType()); MemberValuePair.this.value.computeConversion(scope, requiredType, valueType); } } };
@Override public void run() { if (!(MemberValuePair.this.value.isConstantValueOfTypeAssignableToType(valueType, requiredType) || valueType.isCompatibleWith(requiredType))) { if (!(requiredType.isArrayType() && requiredType.dimensions() == 1 && (MemberValuePair.this.value.isConstantValueOfTypeAssignableToType(valueType, leafType) || valueType.isCompatibleWith(leafType)))) { if (leafType.isAnnotationType() && !valueType.isAnnotationType()) { scope.problemReporter().annotationValueMustBeAnnotation(MemberValuePair.this.binding.declaringClass, MemberValuePair.this.name, MemberValuePair.this.value, leafType); } else { scope.problemReporter().typeMismatchError(valueType, requiredType, MemberValuePair.this.value, null); } shouldExit[0] = true; // TODO may allow to proceed to find more errors at once } } else { scope.compilationUnitScope().recordTypeConversion(requiredType.leafComponentType(), valueType.leafComponentType()); MemberValuePair.this.value.computeConversion(scope, requiredType, valueType); } } };
@Override public void run() { if (!(MemberValuePair.this.value.isConstantValueOfTypeAssignableToType(valueType, requiredType) || valueType.isCompatibleWith(requiredType))) { if (!(requiredType.isArrayType() && requiredType.dimensions() == 1 && (MemberValuePair.this.value.isConstantValueOfTypeAssignableToType(valueType, leafType) || valueType.isCompatibleWith(leafType)))) { if (leafType.isAnnotationType() && !valueType.isAnnotationType()) { scope.problemReporter().annotationValueMustBeAnnotation(MemberValuePair.this.binding.declaringClass, MemberValuePair.this.name, MemberValuePair.this.value, leafType); } else { scope.problemReporter().typeMismatchError(valueType, requiredType, MemberValuePair.this.value, null); } shouldExit[0] = true; // TODO may allow to proceed to find more errors at once } } else { scope.compilationUnitScope().recordTypeConversion(requiredType.leafComponentType(), valueType.leafComponentType()); MemberValuePair.this.value.computeConversion(scope, requiredType, valueType); } } };
@Override public void run() { if (!(MemberValuePair.this.value.isConstantValueOfTypeAssignableToType(valueType, requiredType) || valueType.isCompatibleWith(requiredType))) { if (!(requiredType.isArrayType() && requiredType.dimensions() == 1 && (MemberValuePair.this.value.isConstantValueOfTypeAssignableToType(valueType, leafType) || valueType.isCompatibleWith(leafType)))) { if (leafType.isAnnotationType() && !valueType.isAnnotationType()) { scope.problemReporter().annotationValueMustBeAnnotation(MemberValuePair.this.binding.declaringClass, MemberValuePair.this.name, MemberValuePair.this.value, leafType); } else { scope.problemReporter().typeMismatchError(valueType, requiredType, MemberValuePair.this.value, null); } shouldExit[0] = true; // TODO may allow to proceed to find more errors at once } } else { scope.compilationUnitScope().recordTypeConversion(requiredType.leafComponentType(), valueType.leafComponentType()); MemberValuePair.this.value.computeConversion(scope, requiredType, valueType); } } };
public boolean detectAnnotationCycle() { if ((this.tagBits & TagBits.EndAnnotationCheck) != 0) return false; // already checked if ((this.tagBits & TagBits.BeginAnnotationCheck) != 0) return true; // in the middle of checking its methods this.tagBits |= TagBits.BeginAnnotationCheck; MethodBinding[] currentMethods = methods(); boolean inCycle = false; // check each method before failing for (int i = 0, l = currentMethods.length; i < l; i++) { TypeBinding returnType = currentMethods[i].returnType.leafComponentType(); if (this == returnType) { if (this instanceof SourceTypeBinding) { MethodDeclaration decl = (MethodDeclaration) currentMethods[i].sourceMethod(); ((SourceTypeBinding) this).scope.problemReporter().annotationCircularity(this, this, decl != null ? decl.returnType : null); } } else if (returnType.isAnnotationType() && ((ReferenceBinding) returnType).detectAnnotationCycle()) { if (this instanceof SourceTypeBinding) { MethodDeclaration decl = (MethodDeclaration) currentMethods[i].sourceMethod(); ((SourceTypeBinding) this).scope.problemReporter().annotationCircularity(this, returnType, decl != null ? decl.returnType : null); } inCycle = true; } } if (inCycle) return true; this.tagBits |= TagBits.EndAnnotationCheck; return false; }
public boolean detectAnnotationCycle() { if ((this.tagBits & TagBits.EndAnnotationCheck) != 0) return false; // already checked if ((this.tagBits & TagBits.BeginAnnotationCheck) != 0) return true; // in the middle of checking its methods this.tagBits |= TagBits.BeginAnnotationCheck; MethodBinding[] currentMethods = methods(); boolean inCycle = false; // check each method before failing for (int i = 0, l = currentMethods.length; i < l; i++) { TypeBinding returnType = currentMethods[i].returnType.leafComponentType().erasure(); if (TypeBinding.equalsEquals(this, returnType)) { if (this instanceof SourceTypeBinding) { MethodDeclaration decl = (MethodDeclaration) currentMethods[i].sourceMethod(); ((SourceTypeBinding) this).scope.problemReporter().annotationCircularity(this, this, decl != null ? decl.returnType : null); } } else if (returnType.isAnnotationType() && ((ReferenceBinding) returnType).detectAnnotationCycle()) { if (this instanceof SourceTypeBinding) { MethodDeclaration decl = (MethodDeclaration) currentMethods[i].sourceMethod(); ((SourceTypeBinding) this).scope.problemReporter().annotationCircularity(this, returnType, decl != null ? decl.returnType : null); } inCycle = true; } } if (inCycle) return true; this.tagBits |= TagBits.EndAnnotationCheck; return false; }