8054925: [javadoc] refactor the Doclet start method

Reviewed-by: jjg
This commit is contained in:
Kumar Srinivasan 2014-08-26 08:12:42 -07:00
parent d81bd9fdcf
commit 6abfd1ee2d
2 changed files with 6 additions and 7 deletions

View File

@ -76,7 +76,7 @@ public class HtmlDoclet extends AbstractDoclet {
} else {
doclet = new HtmlDoclet();
}
return doclet.start(doclet, root);
return doclet.startDoclet(root);
}
/**

View File

@ -60,8 +60,8 @@ public abstract class AbstractDoclet {
* 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 @@ public abstract class AbstractDoclet {
/**
* 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;