This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch MNG-6999_racecondition
in repository https://gitbox.apache.org/repos/asf/maven.git


The following commit(s) were added to refs/heads/MNG-6999_racecondition by this 
push:
     new 407837d  [MNG-6999] Move pipedInputStream to preferred location
407837d is described below

commit 407837d68078696fead4061b5838dae57654e622
Author: rfscholte <rfscho...@apache.org>
AuthorDate: Sun Nov 8 14:53:10 2020 +0100

    [MNG-6999] Move pipedInputStream to preferred location
---
 .../apache/maven/model/building/AbstractModelSourceTransformer.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/maven-model-builder/src/main/java/org/apache/maven/model/building/AbstractModelSourceTransformer.java
 
b/maven-model-builder/src/main/java/org/apache/maven/model/building/AbstractModelSourceTransformer.java
index ef88079..3bfd7e7 100644
--- 
a/maven-model-builder/src/main/java/org/apache/maven/model/building/AbstractModelSourceTransformer.java
+++ 
b/maven-model-builder/src/main/java/org/apache/maven/model/building/AbstractModelSourceTransformer.java
@@ -90,8 +90,6 @@ public abstract class AbstractModelSourceTransformer
         final TransformerHandler transformerHandler = getTransformerHandler( 
pomFile );
 
         final PipedOutputStream pout = new PipedOutputStream();
-        final PipedInputStream pipedInputStream = new PipedInputStream( pout );
-        
         OutputStream out = filterOutputStream( pout, pomFile );
 
         final javax.xml.transform.Result result;
@@ -149,7 +147,9 @@ public abstract class AbstractModelSourceTransformer
 
         IOExceptionHandler eh = new IOExceptionHandler();
 
-        
+        // Ensure pipedStreams are connected before the transformThread 
starts!!
+        final PipedInputStream pipedInputStream = new PipedInputStream( pout );
+
         Thread transformThread = new Thread( () -> 
         {
             try ( PipedOutputStream pos = pout )

Reply via email to