You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2020/11/08 11:50:11 UTC

[maven] branch MNG-6999_racecondition created (now 487efc6)

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

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


      at 487efc6  [MNG-6999] create transformer inside thread

This branch includes the following new commits:

     new 487efc6  [MNG-6999] create transformer inside thread

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven] 01/01: [MNG-6999] create transformer inside thread

Posted by rf...@apache.org.
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

commit 487efc6e2d534c7941d6dc7b4461fb3e017f3243
Author: rfscholte <rf...@apache.org>
AuthorDate: Sun Nov 8 12:49:58 2020 +0100

    [MNG-6999] create transformer inside thread
---
 .../apache/maven/model/building/AbstractModelSourceTransformer.java  | 5 +----
 1 file changed, 1 insertion(+), 4 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 b4e8698..9ec2d9c 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
@@ -31,7 +31,6 @@ import java.util.concurrent.atomic.AtomicInteger;
 import java.util.function.Consumer;
 
 import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.Transformer;
 import javax.xml.transform.TransformerConfigurationException;
 import javax.xml.transform.TransformerException;
 import javax.xml.transform.TransformerFactory;
@@ -108,7 +107,6 @@ public abstract class AbstractModelSourceTransformer
             transformerHandler.setResult( new StreamResult( out ) );
         }
 
-        final Transformer transformer;
         final AbstractSAXFilter filter;
         try
         {
@@ -139,7 +137,6 @@ public abstract class AbstractModelSourceTransformer
                     throw exception;
                 }
             } );
-            transformer = transformerFactory.newTransformer();
         }
         catch ( TransformerConfigurationException | SAXException | ParserConfigurationException e )
         {
@@ -156,7 +153,7 @@ public abstract class AbstractModelSourceTransformer
         {
             try ( PipedOutputStream pos = pout )
             {
-                transformer.transform( transformSource, result );
+                transformerFactory.newTransformer().transform( transformSource, result );
             }
             catch ( TransformerException | IOException e )
             {