private void generateMethodJavaDoc(StringBuilder buffer, PsiMethod method, boolean generatePrologue) {
    if (generatePrologue) generatePrologue(buffer);

    if (!isRendered()) {
      buffer.append(DocumentationMarkup.DEFINITION_START);
      myIsSignatureGenerationInProgress = true;
      generateMethodSignature(buffer, method, SignaturePlace.Javadoc);
      myIsSignatureGenerationInProgress = false;
      buffer.append(DocumentationMarkup.DEFINITION_END);
    }

    DocTagLocator<PsiElement[]> descriptionLocator =
      (owner, comment) -> comment != null && !isEmptyDescription(comment) ? comment.getDescriptionElements() : null;

    PsiDocComment comment = getMethodDocComment(method);
    if (comment != null && !isEmptyDescription(comment)) {
      buffer.append(DocumentationMarkup.CONTENT_START);
      generateValue(buffer, comment.getDescriptionElements(), new InheritDocProvider<>() {
        @Override
        public Pair<PsiElement[], InheritDocProvider<PsiElement[]>> getInheritDoc() {
          return findInheritDocTag(method, descriptionLocator);
        }

        @Override
        public PsiClass getElement() {
          return method.getContainingClass();
        }
      });
      buffer.append(DocumentationMarkup.CONTENT_END);
      buffer.append(DocumentationMarkup.SECTIONS_START);
    }
    else {
      buffer.append(DocumentationMarkup.SECTIONS_START);

      if (!isRendered()) {
        buffer.append("<p>");
        Pair<PsiElement[], InheritDocProvider<PsiElement[]>> pair = findInheritDocTag(method, descriptionLocator);
        if (pair != null) {
          PsiElement[] elements = pair.first;
          if (elements != null) {
            PsiClass aClass = pair.second.getElement();
            startHeaderSection(buffer, JavaBundle.message(aClass.isInterface() ? "javadoc.description.copied.from.interface"
                                                                               : "javadoc.description.copied.from.class"))
              .append("<p>");
            generateLink(buffer, aClass, getStyledSpan(doSemanticHighlightingOfLinks(),
                                                       getHighlightingManager().getClassDeclarationAttributes(aClass),
                                                       JavaDocUtil.getShortestClassName(aClass, method)),
                         false);
            buffer.append(BR_TAG);
            generateValue(buffer, elements, pair.second);
            buffer.append(DocumentationMarkup.SECTION_END);
          }
        }
        else {
          PsiField field = PropertyUtil.getFieldOfGetter(method);
          if (field == null) {
            field = PropertyUtil.getFieldOfSetter(method);
          }

          if (field != null) {
            PsiDocComment fieldDocComment = field.getDocComment();
            if (fieldDocComment != null && !isEmptyDescription(fieldDocComment)) {
              startHeaderSection(buffer, JavaBundle.message("javadoc.description.copied.from.field"))
                .append("<p>");
              generateLink(buffer, field, getStyledSpan(doSemanticHighlightingOfLinks(),
                                                        getHighlightingManager().getFieldDeclarationAttributes(field), field.getName()),
                           false);
              buffer.append(BR_TAG);
              generateValue(buffer, fieldDocComment.getDescriptionElements(), ourEmptyElementsProvider);
              buffer.append(DocumentationMarkup.SECTION_END);
            }
          }
        }
      }
    }

    if (!isRendered()) {
      generateSuperMethodsSection(buffer, method, false);
      generateSuperMethodsSection(buffer, method, true);
    }

    if (comment != null) {
      generateDeprecatedSection(buffer, comment);
    }

    generateParametersSection(buffer, method, comment);
    generateTypeParametersSection(buffer, method, comment);
    generateReturnsSection(buffer, method, comment);
    generateThrowsSection(buffer, method, comment);

    if (comment != null) {
      generateApiSection(buffer, comment);
      generateSinceSection(buffer, comment);
      generateSeeAlsoSection(buffer, comment);
      generateAuthorAndVersionSections(buffer, comment);
      generateUnknownTagsSections(buffer, comment);
    }

    buffer.append(DocumentationMarkup.SECTIONS_END);
  }
private void generateMethodJavaDoc(StringBuilder buffer, PsiMethod method, boolean generatePrologue)