Closed brianoliver closed 8 years ago
@brianoliver said: With the refactoring to use Options for specifying parameters, this is now much harder to achieve as every launch request uses a new builder instance.
There's still the possibility that a static reference to an individual builder may be used, but this is probably ok as it would be "by design" when someone does this.
This issue was imported from JIRA ORACLETOOLS-271
Reported by @brianoliver
Marked as works as designed by @brianoliver on Monday, May 9th 2016, 7:41:57 am
Imagine two or more Applications that are started using the same ApplicationConsole.
Now lets imagine that we send (using StdIn) some input using the ApplicationConsole. Which of the Applications receive the StdIn? Do they receive the same input? Do they receive part of the input? Does only one receive the input?
Currently the semantics are undefined (as witnessed by multiple Redirector threads attempting to read from the same shared BufferedInputStream).
For example, below we can see that two redirector threads are attempting to read from the same BufferedInputStream (0x00000000c0051a00).
In reality we should not allow ApplicationConsoles to be shared between Applications, instead new ones should be created (especially for input-purposes). Fortunately we now support using ApplicationConsoleBuilders, which should do the trick!
Fundamentally we need to change the SystemApplicationConsole so that it doesn't read from StdIn, but instead reads from a provided BufferedInputStream (which should not be Stdin). If it is we should warn about it.
Stack Trace: