boolean (@NotNull AnnotationHolder holder, @NotNull GrAnnotation annotation) { if (!GroovyCommonClassNames.GROOVY_LANG_DELEGATES_TO.equals(annotation.getQualifiedName())) return false; final PsiAnnotationMemberValue valueAttribute = annotation.findAttributeValue("value"); if (valueAttribute == null) { final PsiAnnotationOwner owner = annotation.getOwner(); if (owner instanceof GrModifierList) { final PsiElement parent1 = ((GrModifierList)owner).getParent(); if (parent1 instanceof GrParameter) { final PsiElement parent = parent1.getParent(); if (parent instanceof GrParameterList) { for (GrParameter parameter : ((GrParameterList)parent).getParameters()) { if (parameter.getModifierList().hasAnnotation(GroovyCommonClassNames.GROOVY_LANG_DELEGATES_TO_TARGET)) { return true; } } } } } } return false; }