Sorry if this is a nooby question.
When using System.out.println() followed by printing a stack trace, the two seem to overlap and interfere with eachother.
This code:
System.out.println("Multiple definitions for " + analyzer.name + ":");
for (String name : resultNames) {
System.out.println('\t' + name);
}
throw new RuntimeException("Multiple class definitions found matching " + analyzer.name);
produces this output
Exception in thread "main" java.lang.RuntimeException: Multiple class definitions found matching RenderableNode
Multiple definitions for RenderableNode:
at org.lime.apollo.updater.UpdaterApplication.runAnalyzer(UpdaterApplication.java:63)
Analyzer1
Analyzer2
at org.lime.apollo.updater.UpdaterApplication.runAnalyzers(UpdaterApplication.java:70)
Analyzer3
at org.lime.apollo.updater.UpdaterApplication.main(UpdaterApplication.java:87)
The expected behavior is for Analyzer1, Analyzer2, etc to be printed before any of the stack trace. But instead the two seem to be printing on top of eachother, which makes a result that is hard to read.
What am I doing wrong?
Edit: Kon's answer below explains this, but I don't know how to mark as solved.
stderrandstdout) which are handled by different threads of the OS, I believe. That's why you see overlap.