private void generatePackageJavaDoc(StringBuilder buffer, PsiPackage psiPackage, boolean generatePrologue) {
    boolean hasInfo = false;
    for (PsiDirectory directory : psiPackage.getDirectories(GlobalSearchScope.everythingScope(myProject))) {
      PsiFile packageInfoFile = directory.findFile(PsiPackage.PACKAGE_INFO_FILE);
      if (packageInfoFile != null) {
        ASTNode node = packageInfoFile.getNode();
        if (node != null) {
          ASTNode docCommentNode = findRelevantCommentNode(node);
          if (docCommentNode != null) {
            generatePackageJavaDoc(buffer, (PsiDocComment)docCommentNode.getPsi(), generatePrologue);
            hasInfo = true;
            break;
          }
        }
      }
      PsiFile packageHtmlFile = directory.findFile("package.html");
      if (packageHtmlFile != null) {
        generatePackageHtmlJavaDoc(buffer, packageHtmlFile, generatePrologue);
        hasInfo = true;
        break;
      }
    }
    if (!hasInfo) {
      generateDefaultPackageDoc(buffer, psiPackage, generatePrologue);
    }
  }
private void generatePackageJavaDoc(StringBuilder buffer, PsiPackage psiPackage, boolean generatePrologue)