diff options
author | Christopher Vogt <oss.nsp@cvogt.org> | 2016-11-03 03:11:34 +0000 |
---|---|---|
committer | Christopher Vogt <oss.nsp@cvogt.org> | 2016-11-03 16:28:51 -0400 |
commit | af5b01020becf5bce1139130d7f16c88a4982c68 (patch) | |
tree | a901fed66913384b3d7057973c9facc1385fc84b | |
parent | 775a9582942e64bf492687194e016f2034a81feb (diff) | |
download | cbt-af5b01020becf5bce1139130d7f16c88a4982c68.tar.gz cbt-af5b01020becf5bce1139130d7f16c88a4982c68.tar.bz2 cbt-af5b01020becf5bce1139130d7f16c88a4982c68.zip |
fix interactivity with stdout and stderr replacements
-rw-r--r-- | nailgun_launcher/NailgunLauncher.java | 6 | ||||
-rw-r--r-- | nailgun_launcher/ThreadLocalOutputStream.java | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/nailgun_launcher/NailgunLauncher.java b/nailgun_launcher/NailgunLauncher.java index b1daf2a..6639218 100644 --- a/nailgun_launcher/NailgunLauncher.java +++ b/nailgun_launcher/NailgunLauncher.java @@ -67,13 +67,13 @@ public class NailgunLauncher{ System.out.getClass().getDeclaredField("streams"); // nailgun ThreadLocalPrintStream assert(System.out.getClass().getName() == "com.martiansoftware.nailgun.ThreadLocalPrintStream"); } catch( NoSuchFieldException e ){ - System.setOut( new PrintStream(new ThreadLocalOutputStream(System.out)) ); + System.setOut( new PrintStream(new ThreadLocalOutputStream(System.out), true) ); } try{ System.err.getClass().getDeclaredField("streams"); // nailgun ThreadLocalPrintStream - assert(System.out.getClass().getName() == "com.martiansoftware.nailgun.ThreadLocalPrintStream"); + assert(System.err.getClass().getName() == "com.martiansoftware.nailgun.ThreadLocalPrintStream"); } catch( NoSuchFieldException e ){ - System.setErr( new PrintStream(new ThreadLocalOutputStream(System.err)) ); + System.setErr( new PrintStream(new ThreadLocalOutputStream(System.err), true) ); } // --------------------- diff --git a/nailgun_launcher/ThreadLocalOutputStream.java b/nailgun_launcher/ThreadLocalOutputStream.java index c12b775..0b106d7 100644 --- a/nailgun_launcher/ThreadLocalOutputStream.java +++ b/nailgun_launcher/ThreadLocalOutputStream.java @@ -27,4 +27,8 @@ public class ThreadLocalOutputStream extends OutputStream{ // so probably this is not a problem performance get().write(b); } + + public void flush() throws IOException{ + get().flush(); + } } |