6978886: javadoc shows stacktrace after print error resulting from disk full
Reviewed-by: jjg
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java Fri Sep 27 17:28:31 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java Fri Sep 27 21:20:01 2013 +0400
@@ -194,6 +194,10 @@
.getClassBuilder(curr, prev, next, classtree);
classBuilder.build();
}
+ } catch (IOException e) {
+ throw new DocletAbortException(e);
+ } catch (DocletAbortException de) {
+ throw de;
} catch (Exception e) {
e.printStackTrace();
throw new DocletAbortException(e);
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AbstractDoclet.java Fri Sep 27 17:28:31 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AbstractDoclet.java Fri Sep 27 21:20:01 2013 +0400
@@ -83,6 +83,16 @@
} catch (Configuration.Fault f) {
root.printError(f.getMessage());
return false;
+ } catch (DocletAbortException e) {
+ Throwable cause = e.getCause();
+ if (cause != null) {
+ if (cause.getLocalizedMessage() != null) {
+ root.printError(cause.getLocalizedMessage());
+ } else {
+ root.printError(cause.toString());
+ }
+ }
+ return false;
} catch (Exception exc) {
exc.printStackTrace();
return false;
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractBuilder.java Fri Sep 27 17:28:31 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractBuilder.java Fri Sep 27 21:20:01 2013 +0400
@@ -140,7 +140,7 @@
configuration.root.printError("Unknown element: " + component);
throw new DocletAbortException(e);
} catch (InvocationTargetException e) {
- e.getCause().printStackTrace();
+ throw new DocletAbortException(e.getCause());
} catch (Exception e) {
e.printStackTrace();
configuration.root.printError("Exception " +