private void checkDelegatesTo(GrAnnotation annotation) {
        if (!GroovyCommonClassNames.GROOVY_LANG_DELEGATES_TO.equals(annotation.getQualifiedName())) return;

        final PsiElement owner = annotation.getParent().getParent();
        if (!(owner instanceof GrParameter)) return;

        final PsiAnnotationMemberValue targetPair = annotation.findDeclaredAttributeValue("target");
        if (targetPair == null) return;

        String targetName = GrAnnotationUtil.inferStringAttribute(annotation, "target");

        final GrParameterList parameterList = (GrParameterList)owner.getParent();
        for (GrParameter parameter : parameterList.getParameters()) {
          final PsiAnnotation target = parameter.getModifierList().findAnnotation(GroovyCommonClassNames.GROOVY_LANG_DELEGATES_TO_TARGET);
          if (target != null) {
            final String curTarget = GrAnnotationUtil.inferStringAttribute(target, "value");
            if (curTarget != null && curTarget.equals(targetName)) {
              return; //target is used
            }
          }
        }

        registerError(targetPair, GroovyBundle.message("target.0.does.not.exist", targetName != null ? targetName : "?"),
                      LocalQuickFix.EMPTY_ARRAY, ProblemHighlightType.GENERIC_ERROR_OR_WARNING);
      }
private void checkDelegatesTo(GrAnnotation annotation)