int generateLink(StringBuilder buffer, String refText, String label, @NotNull PsiElement context, boolean plainLink) {
    if (label == null) {
      PsiManager manager = context.getManager();
      label = JavaDocUtil.getLabelText(manager.getProject(), manager, refText, context);
    }
    LOG.assertTrue(refText != null, "refText appears to be null.");
    PsiElement target = null;
    try {
      target = JavaDocUtil.findReferenceTarget(context.getManager(), refText, context, false);
    }
    catch (IndexNotReadyException e) {
      LOG.debug(e);
    }
    appendMaybeUnresolvedLink(buffer, target, label, context.getProject(), plainLink);
    return StringUtil.stripHtml(label, true).length();
  }
int generateLink(StringBuilder buffer, String refText, String label, @NotNull PsiElement context, boolean plainLink)