6978886: javadoc shows stacktrace after print error resulting from disk full
authorkizune
Fri, 27 Sep 2013 21:20:01 +0400
changeset 20600 052970964bc1
parent 20599 5201f7144a3c
child 20601 37d675394c73
6978886: javadoc shows stacktrace after print error resulting from disk full Reviewed-by: jjg
langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java
langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AbstractDoclet.java
langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractBuilder.java
--- 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 " +