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 (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;
}
}