8073519: schemagen does not report errors while generating xsd files
authoraefimov
Fri, 16 Oct 2015 19:07:08 +0300
changeset 33014 a71b9ae28cbe
parent 32971 1a52a30674cd
child 33015 9d153359b8ff
8073519: schemagen does not report errors while generating xsd files Reviewed-by: dfuchs
jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/SchemaGenerator.java
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/SchemaGenerator.java	Wed Jul 05 20:54:03 2017 +0200
+++ b/jaxws/src/jdk.xml.bind/share/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;
@@ -248,7 +249,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;
         }
     }