Repository: maven-surefire Updated Branches: refs/heads/junit5 8eae2878c -> da9281412
[SUREFIRE] optimized writings to the PrintStream Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/61c7257a Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/61c7257a Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/61c7257a Branch: refs/heads/junit5 Commit: 61c7257a33b08076ccd3fab407af6a0ee0006b99 Parents: ef06e41 Author: Tibor17 <tibo...@lycos.com> Authored: Wed Sep 21 01:46:10 2016 +0200 Committer: Tibor17 <tibo...@lycos.com> Committed: Sat Sep 24 10:38:16 2016 +0200 ---------------------------------------------------------------------- .../org/apache/maven/surefire/booter/ForkingRunListener.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/61c7257a/surefire-api/src/main/java/org/apache/maven/surefire/booter/ForkingRunListener.java ---------------------------------------------------------------------- diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/booter/ForkingRunListener.java b/surefire-api/src/main/java/org/apache/maven/surefire/booter/ForkingRunListener.java index d0d8cca..282c4d4 100644 --- a/surefire-api/src/main/java/org/apache/maven/surefire/booter/ForkingRunListener.java +++ b/surefire-api/src/main/java/org/apache/maven/surefire/booter/ForkingRunListener.java @@ -199,11 +199,13 @@ public class ForkingRunListener new byte[buf.length * 3 + 1]; // Hex-escaping can be up to 3 times length of a regular byte. int i = escapeBytesToPrintable( content, 0, buf, off, len ); content[i++] = (byte) '\n'; + byte[] encodeBytes = new byte[header.length + i]; + System.arraycopy( header, 0, encodeBytes, 0, header.length ); + System.arraycopy( content, 0, encodeBytes, header.length, i ); synchronized ( target ) // See notes about synchronization/thread safety in class javadoc { - target.write( header, 0, header.length ); - target.write( content, 0, i ); + target.write( encodeBytes, 0, encodeBytes.length ); } }