8219575: jdk/javadoc/tool/removeOldDoclet/RemoveOldDoclet test fails in mach5
authorpmuthuswamy
Fri, 22 Feb 2019 19:58:22 +0530
changeset 53896 b47fd614c75e
parent 53895 b22d8ae270a2
child 53897 0abec72a3ac2
8219575: jdk/javadoc/tool/removeOldDoclet/RemoveOldDoclet test fails in mach5 Reviewed-by: hannesw
src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Start.java
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Start.java	Fri Feb 22 14:20:06 2019 +0100
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Start.java	Fri Feb 22 19:58:22 2019 +0530
@@ -756,6 +756,13 @@
                 }
                 String text = messager.getText("main.doclet_class_not_found", userDocletName);
                 throw new ToolException(CMDERR, text, cnfe);
+            } catch (NoClassDefFoundError ncfe) {
+                if (ncfe.getMessage().contains("com/sun/javadoc/Doclet")) {
+                    String text = messager.getText("main.not_a_doclet", userDocletName);
+                    throw new ToolException(ERROR, text, ncfe);
+                } else {
+                    throw ncfe;
+                }
             }
         }