8073519: schemagen does not report errors while generating xsd files

Reviewed-by: dfuchs
This commit is contained in:
Aleksei Efimov 2015-10-16 19:07:08 +03:00
parent aa8e6904dc
commit 67468ad3ea

View File

@ -30,6 +30,7 @@ import com.sun.tools.internal.xjc.BadCommandLineException;
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 @@ public class SchemaGenerator {
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;
}
}