langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleFrameWriter.java
changeset 40587 1c355ea550ed
parent 40508 74ef30d16fb9
child 42277 2668b0bc7ad7
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleFrameWriter.java	Wed Jul 05 22:07:34 2017 +0200
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleFrameWriter.java	Mon Aug 22 16:32:40 2016 -0700
@@ -25,7 +25,6 @@
 
 package jdk.javadoc.internal.doclets.formats.html;
 
-import java.io.*;
 import java.util.*;
 
 import javax.lang.model.element.ModuleElement;
@@ -39,8 +38,8 @@
 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
 import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
 import jdk.javadoc.internal.doclets.toolkit.Content;
+import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
 import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
-import jdk.javadoc.internal.doclets.toolkit.util.DocletAbortException;
 
 
 /**
@@ -76,8 +75,7 @@
      * @param configuration the configuration of the doclet.
      * @param moduleElement moduleElement under consideration.
      */
-    public ModuleFrameWriter(ConfigurationImpl configuration, ModuleElement moduleElement)
-            throws IOException {
+    public ModuleFrameWriter(ConfigurationImpl configuration, ModuleElement moduleElement) {
         super(configuration, DocPaths.moduleTypeFrame(moduleElement));
         this.mdle = moduleElement;
         if (configuration.getSpecifiedPackages().isEmpty()) {
@@ -91,35 +89,29 @@
      *
      * @param configuration the current configuration of the doclet.
      * @param moduleElement The package for which "module_name-type-frame.html" is to be generated.
+     * @throws DocFileIOException if there is a problem generating the module summary file
      */
-    public static void generate(ConfigurationImpl configuration, ModuleElement moduleElement) {
-        ModuleFrameWriter mdlgen;
-        try {
-            mdlgen = new ModuleFrameWriter(configuration, moduleElement);
-            String mdlName = moduleElement.getQualifiedName().toString();
-            Content mdlLabel = new StringContent(mdlName);
-            HtmlTree body = mdlgen.getBody(false, mdlgen.getWindowTitle(mdlName));
-            HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN))
-                    ? HtmlTree.MAIN()
-                    : body;
-            Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, HtmlStyle.bar,
-                    mdlgen.getHyperLink(DocPaths.moduleSummary(moduleElement), mdlLabel, "", "classFrame"));
-            htmlTree.addContent(heading);
-            HtmlTree div = new HtmlTree(HtmlTag.DIV);
-            div.addStyle(HtmlStyle.indexContainer);
-            mdlgen.addClassListing(div);
-            htmlTree.addContent(div);
-            if (configuration.allowTag(HtmlTag.MAIN)) {
-                body.addContent(htmlTree);
-            }
-            mdlgen.printHtmlDocument(
-                    configuration.metakeywords.getMetaKeywordsForModule(moduleElement), false, body);
-        } catch (IOException exc) {
-            configuration.messages.error(
-                    "doclet.exception_encountered",
-                    exc.toString(), DocPaths.moduleTypeFrame(moduleElement).getPath());
-            throw new DocletAbortException(exc);
+    public static void generate(ConfigurationImpl configuration, ModuleElement moduleElement)
+            throws DocFileIOException {
+        ModuleFrameWriter mdlgen = new ModuleFrameWriter(configuration, moduleElement);
+        String mdlName = moduleElement.getQualifiedName().toString();
+        Content mdlLabel = new StringContent(mdlName);
+        HtmlTree body = mdlgen.getBody(false, mdlgen.getWindowTitle(mdlName));
+        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN))
+                ? HtmlTree.MAIN()
+                : body;
+        Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, HtmlStyle.bar,
+                mdlgen.getHyperLink(DocPaths.moduleSummary(moduleElement), mdlLabel, "", "classFrame"));
+        htmlTree.addContent(heading);
+        HtmlTree div = new HtmlTree(HtmlTag.DIV);
+        div.addStyle(HtmlStyle.indexContainer);
+        mdlgen.addClassListing(div);
+        htmlTree.addContent(div);
+        if (configuration.allowTag(HtmlTag.MAIN)) {
+            body.addContent(htmlTree);
         }
+        mdlgen.printHtmlDocument(
+                configuration.metakeywords.getMetaKeywordsForModule(moduleElement), false, body);
     }
 
     /**