< prev index next >

langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Start.java

Print this page

        

*** 86,98 **** * @author Robert Field * @author Neal Gafter (rewrite) */ public class Start extends ToolOption.Helper { ! @SuppressWarnings("deprecation") ! private static final Class<?> OldStdDoclet = ! com.sun.tools.doclets.standard.Standard.class; private static final Class<?> StdDoclet = jdk.javadoc.doclet.StandardDoclet.class; /** Context for this invocation. */ private final Context context; --- 86,97 ---- * @author Robert Field * @author Neal Gafter (rewrite) */ public class Start extends ToolOption.Helper { ! private static final String OldStdDocletName = ! "com.sun.tools.doclets.standard.Standard"; private static final Class<?> StdDoclet = jdk.javadoc.doclet.StandardDoclet.class; /** Context for this invocation. */ private final Context context;
*** 332,342 **** int rc = com.sun.tools.javadoc.Main.execute( messager.programName, messager.getWriter(WriterKind.ERROR), messager.getWriter(WriterKind.WARNING), messager.getWriter(WriterKind.NOTICE), ! "com.sun.tools.doclets.standard.Standard", nargv); return (rc == 0) ? OK : ERROR; } return begin(Arrays.asList(argv), Collections.emptySet()); } --- 331,341 ---- int rc = com.sun.tools.javadoc.Main.execute( messager.programName, messager.getWriter(WriterKind.ERROR), messager.getWriter(WriterKind.WARNING), messager.getWriter(WriterKind.NOTICE), ! OldStdDocletName, nargv); return (rc == 0) ? OK : ERROR; } return begin(Arrays.asList(argv), Collections.emptySet()); }
*** 795,825 **** } } // Step 4: we have a doclet, try loading it if (docletName != null) { ! try { ! return Class.forName(docletName, true, getClass().getClassLoader()); ! } catch (ClassNotFoundException cnfe) { ! if (apiMode) { ! throw new IllegalArgumentException("Cannot find doclet class " + userDocletName); ! } ! String text = messager.getText("main.doclet_class_not_found", userDocletName); ! throw new ToolException(CMDERR, text, cnfe); ! } } // Step 5: we don't have a doclet specified, do we have taglets ? if (!userTagletNames.isEmpty() && hasOldTaglet(userTagletNames, userTagletPath)) { // found a bogey, return the old doclet ! return OldStdDoclet; } // finally return StdDoclet; } /* * This method returns true iff it finds a legacy taglet, but for * all other conditions including errors it returns false, allowing * nature to take its own course. */ --- 794,828 ---- } } // Step 4: we have a doclet, try loading it if (docletName != null) { ! return loadDocletClass(docletName); } // Step 5: we don't have a doclet specified, do we have taglets ? if (!userTagletNames.isEmpty() && hasOldTaglet(userTagletNames, userTagletPath)) { // found a bogey, return the old doclet ! return loadDocletClass(OldStdDocletName); } // finally return StdDoclet; } + private Class<?> loadDocletClass(String docletName) throws ToolException { + try { + return Class.forName(docletName, true, getClass().getClassLoader()); + } catch (ClassNotFoundException cnfe) { + if (apiMode) { + throw new IllegalArgumentException("Cannot find doclet class " + docletName); + } + String text = messager.getText("main.doclet_class_not_found", docletName); + throw new ToolException(CMDERR, text, cnfe); + } + } + /* * This method returns true iff it finds a legacy taglet, but for * all other conditions including errors it returns false, allowing * nature to take its own course. */
< prev index next >