changeset 1070:70d4d5435eb4

8073519: schemagen does not report errors while generating xsd files Reviewed-by: dfuchs
author aefimov
date Fri, 16 Oct 2015 19:07:08 +0300
parents c51556c23de3
children b2b41f383c88
files src/share/jaxws_classes/com/sun/tools/internal/jxc/SchemaGenerator.java
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/jaxws_classes/com/sun/tools/internal/jxc/SchemaGenerator.java	Tue Oct 06 10:51:49 2015 -0700
+++ b/src/share/jaxws_classes/com/sun/tools/internal/jxc/SchemaGenerator.java	Fri Oct 16 19:07:08 2015 +0300
@@ -30,6 +30,7 @@
 import com.sun.xml.internal.bind.util.Which;
 
 import javax.lang.model.SourceVersion;
+import javax.tools.Diagnostic;
 import javax.tools.DiagnosticCollector;
 import javax.tools.JavaCompiler;
 import javax.tools.JavaFileObject;
@@ -239,7 +240,12 @@
             if (episode != null)
                 r.setEpisodeFile(episode);
             task.setProcessors(Collections.singleton(r));
-            return task.call();
+            boolean res = task.call();
+            //Print messages generated by compiler
+            for (Diagnostic<? extends JavaFileObject> d : diagnostics.getDiagnostics()) {
+                 System.err.println(d.toString());
+            }
+            return res;
         }
     }