You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ti...@apache.org on 2019/07/29 08:09:09 UTC

[maven-archetype] branch buildfix updated: Revert "deleted unnecessary calls ".flush()""

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

tibordigana pushed a commit to branch buildfix
in repository https://gitbox.apache.org/repos/asf/maven-archetype.git


The following commit(s) were added to refs/heads/buildfix by this push:
     new a61fa01  Revert "deleted unnecessary calls ".flush()""
a61fa01 is described below

commit a61fa01645096dabc1eafcfc84ce3b8e5dcb6a53
Author: tibordigana <ti...@apache.org>
AuthorDate: Mon Jul 29 10:08:48 2019 +0200

    Revert "deleted unnecessary calls ".flush()""
    
    This reverts commit 7995ddbc
---
 .../org/apache/maven/archetype/DefaultArchetypeManager.java  |  2 ++
 .../org/apache/maven/archetype/common/util/XMLOutputter.java | 12 ++++++++++++
 .../generator/DefaultFilesetArchetypeGenerator.java          |  2 ++
 .../org/apache/maven/archetype/old/DefaultOldArchetype.java  |  2 ++
 .../apache/maven/archetype/mojos/IntegrationTestMojo.java    |  1 +
 5 files changed, 19 insertions(+)

diff --git a/archetype-common/src/main/java/org/apache/maven/archetype/DefaultArchetypeManager.java b/archetype-common/src/main/java/org/apache/maven/archetype/DefaultArchetypeManager.java
index 51119a1..e6dbbd5 100644
--- a/archetype-common/src/main/java/org/apache/maven/archetype/DefaultArchetypeManager.java
+++ b/archetype-common/src/main/java/org/apache/maven/archetype/DefaultArchetypeManager.java
@@ -152,6 +152,8 @@ public class DefaultArchetypeManager
                     IOUtil.copy( is, zos );
                 }
 
+                zos.flush();
+
                 zos.closeEntry();
             }
         }
diff --git a/archetype-common/src/main/java/org/apache/maven/archetype/common/util/XMLOutputter.java b/archetype-common/src/main/java/org/apache/maven/archetype/common/util/XMLOutputter.java
index 6b9ca9a..58e00d1 100644
--- a/archetype-common/src/main/java/org/apache/maven/archetype/common/util/XMLOutputter.java
+++ b/archetype-common/src/main/java/org/apache/maven/archetype/common/util/XMLOutputter.java
@@ -437,6 +437,8 @@ public class XMLOutputter
         // Output final line separator
         // We output this no matter what the newline flags say
         out.write( currentFormat.lineSeparator );
+
+        out.flush();
     }
 
     /**
@@ -449,6 +451,7 @@ public class XMLOutputter
         throws IOException
     {
         printDocType( out, doctype );
+        out.flush();
     }
 
     /**
@@ -465,6 +468,7 @@ public class XMLOutputter
         // If this is the root element we could pre-initialize the
         // namespace stack with the namespaces
         printElement( out, element, 0, createNamespaceStack() );
+        out.flush();
     }
 
     /**
@@ -483,6 +487,7 @@ public class XMLOutputter
         List<?> content = element.getContent();
         printContentRange( out, content, 0, content.size(),
             0, createNamespaceStack() );
+        out.flush();
     }
 
     /**
@@ -498,6 +503,7 @@ public class XMLOutputter
         throws IOException
     {
         printContentRange( out, list, 0, list.size(), 0, createNamespaceStack() );
+        out.flush();
     }
 
     /**
@@ -510,6 +516,7 @@ public class XMLOutputter
         throws IOException
     {
         printCDATA( out, cdata );
+        out.flush();
     }
 
     /**
@@ -523,6 +530,7 @@ public class XMLOutputter
         throws IOException
     {
         printText( out, text );
+        out.flush();
     }
 
     /**
@@ -535,6 +543,7 @@ public class XMLOutputter
         throws IOException
     {
         printComment( out, comment );
+        out.flush();
     }
 
     /**
@@ -552,6 +561,8 @@ public class XMLOutputter
         currentFormat.setIgnoreTrAXEscapingPIs( true );
         printProcessingInstruction( out, pi );
         currentFormat.setIgnoreTrAXEscapingPIs( currentEscapingPolicy );
+
+        out.flush();
     }
 
     /**
@@ -564,6 +575,7 @@ public class XMLOutputter
         throws IOException
     {
         printEntityRef( out, entity );
+        out.flush();
     }
 
     // * * * * * * * * * * Output to a String * * * * * * * * * *
diff --git a/archetype-common/src/main/java/org/apache/maven/archetype/generator/DefaultFilesetArchetypeGenerator.java b/archetype-common/src/main/java/org/apache/maven/archetype/generator/DefaultFilesetArchetypeGenerator.java
index c0548ff..790a982 100644
--- a/archetype-common/src/main/java/org/apache/maven/archetype/generator/DefaultFilesetArchetypeGenerator.java
+++ b/archetype-common/src/main/java/org/apache/maven/archetype/generator/DefaultFilesetArchetypeGenerator.java
@@ -714,6 +714,8 @@ public class DefaultFilesetArchetypeGenerator
             velocity.getEngine().mergeTemplate( templateFileName, encoding, context, stringWriter );
 
             writer.write( StringUtils.unifyLineSeparators( stringWriter.toString() ) );
+
+            writer.flush();
         }
         catch ( Exception e )
         {
diff --git a/archetype-common/src/main/java/org/apache/maven/archetype/old/DefaultOldArchetype.java b/archetype-common/src/main/java/org/apache/maven/archetype/old/DefaultOldArchetype.java
index 573ef41..5e90fc5 100644
--- a/archetype-common/src/main/java/org/apache/maven/archetype/old/DefaultOldArchetype.java
+++ b/archetype-common/src/main/java/org/apache/maven/archetype/old/DefaultOldArchetype.java
@@ -759,6 +759,8 @@ public class DefaultOldArchetype
                 velocity.getEngine().mergeTemplate( template, descriptor.getEncoding(), context, stringWriter );
 
                 writer.write( StringUtils.unifyLineSeparators( stringWriter.toString() ) );
+
+                writer.flush();
             }
             catch ( Exception e )
             {
diff --git a/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/IntegrationTestMojo.java b/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/IntegrationTestMojo.java
index 0efeb14..7e7d435 100644
--- a/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/IntegrationTestMojo.java
+++ b/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/IntegrationTestMojo.java
@@ -816,6 +816,7 @@ public class IntegrationTestMojo
                 interpolatedFile.getParentFile().mkdirs();
                 
                 writer.write( xml );
+                writer.flush();
             }
         }
         catch ( IOException e )