IDEA-90129 Run Tool window does not show all console output - myReader.ready() always returns false

(cherry-picked from df83ad7)
This commit is contained in:
Sergey Simonchik
2012-08-15 13:57:25 +04:00
parent 987e6f6212
commit 57f3711621
@@ -33,6 +33,7 @@ public abstract class BaseOutputReader {
protected volatile boolean isStopped = false;
private final char[] myBuffer = new char[8192];
private final StringBuilder myTextBuffer = new StringBuilder();
private boolean skipLF = false;
private Future<?> myFinishedFuture = null;
@@ -78,12 +79,12 @@ public abstract class BaseOutputReader {
protected synchronized boolean readAvailable() throws IOException {
char[] buffer = myBuffer;
StringBuilder token = new StringBuilder();
StringBuilder token = myTextBuffer;
token.setLength(0);
boolean read = false;
while (myReader.ready()) {
int n = myReader.read(buffer);
if (n <= 0) break;
int n;
while ((n = myReader.read(buffer)) > 0) {
read = true;
for (int i = 0; i < n; i++) {