static HighlightInfo.Builder checkNameValuePair(@NotNull PsiNameValuePair pair) {
    PsiAnnotation annotation = PsiTreeUtil.getParentOfType(pair, PsiAnnotation.class);
    if (annotation == null) return null;
    PsiClass annotationClass = annotation.resolveAnnotationType();
    if (annotationClass == null) return null;
    PsiReference ref = pair.getReference();
    if (ref == null) return null;
    PsiMethod method = (PsiMethod)ref.resolve();
    if (method == null) {
      if (pair.getName() != null) {
        String description = JavaErrorBundle.message("annotation.unknown.method", ref.getCanonicalText());
        HighlightInfo.Builder builder = HighlightInfo.newHighlightInfo(HighlightInfoType.WRONG_REF)
          .range(ref.getElement(), ref.getRangeInElement())
          .descriptionAndTooltip(description);
        IntentionAction action = QuickFixFactory.getInstance().createCreateAnnotationMethodFromUsageFix(pair);
        builder.registerFix(action, null, null, null, null);
        return builder;
      }
      else {
        String description = JavaErrorBundle.message("annotation.missing.method", ref.getCanonicalText());
        PsiElement element = ref.getElement();
        HighlightInfo.Builder highlightInfo =
          HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(element).descriptionAndTooltip(description);
        for (IntentionAction action : QuickFixFactory.getInstance().createAddAnnotationAttributeNameFixes(pair)) {
          highlightInfo.registerFix(action, null, null, null, null);
        }
        return highlightInfo;
      }
    }
    else {
      PsiType returnType = method.getReturnType();
      assert returnType != null : method;
      PsiAnnotationMemberValue value = pair.getValue();
      if (value != null) {
        HighlightInfo.Builder info = checkMemberValueType(value, returnType, method);
        if (info != null) return info;
      }

      return checkDuplicateAttribute(pair);
    }
  }
static HighlightInfo.Builder checkNameValuePair(@NotNull PsiNameValuePair pair)