8054925: [javadoc] refactor the Doclet start method.
authorksrini
Tue, 26 Aug 2014 08:12:42 -0700
changeset 26269 0d8efbb110b4
parent 26268 620556167c08
child 26270 a3635e6d3d78
8054925: [javadoc] refactor the Doclet start method. Reviewed-by: jjg
langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java
langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/AbstractDoclet.java
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java	Wed Aug 27 06:25:17 2014 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java	Tue Aug 26 08:12:42 2014 -0700
@@ -76,7 +76,7 @@
         } else {
             doclet = new HtmlDoclet();
         }
-        return doclet.start(doclet, root);
+        return doclet.startDoclet(root);
     }
 
     /**
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/AbstractDoclet.java	Wed Aug 27 06:25:17 2014 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/AbstractDoclet.java	Tue Aug 26 08:12:42 2014 -0700
@@ -60,8 +60,8 @@
      * Verify that the only doclet that is using this toolkit is
      * {@value #TOOLKIT_DOCLET_NAME}.
      */
-    private boolean isValidDoclet(AbstractDoclet doclet) {
-        if (! doclet.getClass().getName().equals(TOOLKIT_DOCLET_NAME)) {
+    private boolean isValidDoclet() {
+        if (!getClass().getName().equals(TOOLKIT_DOCLET_NAME)) {
             configuration.message.error("doclet.Toolkit_Usage_Violation",
                 TOOLKIT_DOCLET_NAME);
             return false;
@@ -72,19 +72,18 @@
     /**
      * The method that starts the execution of the doclet.
      *
-     * @param doclet the doclet to start the execution for.
      * @param root   the {@link RootDoc} that points to the source to document.
      * @return true if the doclet executed without error.  False otherwise.
      */
-    public boolean start(AbstractDoclet doclet, RootDoc root) {
+    public boolean startDoclet(RootDoc root) {
         configuration = configuration();
         configuration.root = root;
         utils = configuration.utils;
-        if (! isValidDoclet(doclet)) {
+        if (!isValidDoclet()) {
             return false;
         }
         try {
-            doclet.startGeneration(root);
+            startGeneration(root);
         } catch (Configuration.Fault f) {
             root.printError(f.getMessage());
             return false;