You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2023/01/15 10:41:51 UTC

[maven] branch MNG-7664 updated (d15cc3f68 -> c8e8d791d)

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

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


 discard d15cc3f68 [MNG-7664] remove unintended differences
     new c8e8d791d [MNG-7664] remove unintended differences

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (d15cc3f68)
            \
             N -- N -- N   refs/heads/MNG-7664 (c8e8d791d)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

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.


Summary of changes:
 maven-plugin-api/src/main/mdo/reader.vm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)


[maven] 01/01: [MNG-7664] remove unintended differences

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit c8e8d791d69e6cf4466ad9e7f7fc153c33f905ff
Author: Hervé Boutemy <hb...@apache.org>
AuthorDate: Sun Jan 15 11:39:56 2023 +0100

    [MNG-7664] remove unintended differences
---
 maven-plugin-api/src/main/mdo/merger.vm |  7 +++----
 maven-plugin-api/src/main/mdo/reader.vm |  5 ++++-
 maven-plugin-api/src/main/mdo/writer.vm | 10 +++++-----
 3 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/maven-plugin-api/src/main/mdo/merger.vm b/maven-plugin-api/src/main/mdo/merger.vm
index 98b04d462..57d4fab0c 100644
--- a/maven-plugin-api/src/main/mdo/merger.vm
+++ b/maven-plugin-api/src/main/mdo/merger.vm
@@ -38,7 +38,6 @@ import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Properties;
 import java.util.Objects;
 import java.util.function.BinaryOperator;
 import java.util.function.Function;
@@ -122,10 +121,10 @@ public class ${className}
       #elseif ( $field.type == "java.util.List" && $field.to == "String" && $field.multiplicity == "*" )
         builder.${field.name}( merge( target.get${capField}(), source.get${capField}(), sourceDominant, e -> e ) );
       #elseif ( $field.type == "java.util.Properties" && $field.to == "String" && $field.multiplicity == "*" )
-        Properties src = source.get${capField}();
+        Map<String, String> src = source.get${capField}();
         if ( !src.isEmpty() )
         {
-            Properties tgt = target.get${capField}();
+            Map<String, String> tgt = target.get${capField}();
             if ( tgt.isEmpty() )
             {
                 builder.${field.name}( src );
@@ -135,7 +134,7 @@ public class ${className}
             }
             else
             {
-                Properties merged = new Properties();
+                Map<String, String> merged = new HashMap<>();
                 merged.putAll( sourceDominant ? target.get${capField}() : source.get${capField}() );
                 merged.putAll( sourceDominant ? source.get${capField}() : target.get${capField}() );
                 builder.${field.name}( merged );
diff --git a/maven-plugin-api/src/main/mdo/reader.vm b/maven-plugin-api/src/main/mdo/reader.vm
index 54b3882bb..02e9199ba 100644
--- a/maven-plugin-api/src/main/mdo/reader.vm
+++ b/maven-plugin-api/src/main/mdo/reader.vm
@@ -39,8 +39,11 @@ import java.io.Reader;
 import java.text.DateFormat;
 import java.util.ArrayList;
 import java.util.Date;
+import java.util.HashMap;
 import java.util.HashSet;
+import java.util.LinkedHashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
 import org.apache.maven.api.annotations.Generated;
@@ -769,7 +772,7 @@ public class ${className}
                     ${classLcapName}.${field.name}( ${field.name} );
                     break;
       #elseif ( $field.type == "java.util.Properties" && $field.to == "String" && $field.multiplicity == "*" )
-                    Properties ${field.name} = new Properties();
+                    Map<String, String> ${field.name} = new LinkedHashMap<>();
                     while ( parser.nextTag() == XmlPullParser.START_TAG )
                     {
                         String key = parser.getName();
diff --git a/maven-plugin-api/src/main/mdo/writer.vm b/maven-plugin-api/src/main/mdo/writer.vm
index 7c2f46e36..7b2c805d3 100644
--- a/maven-plugin-api/src/main/mdo/writer.vm
+++ b/maven-plugin-api/src/main/mdo/writer.vm
@@ -98,7 +98,7 @@ public class ${className}
      *
      * @param writer a writer object
      * @param ${rootLcapName} a ${root.name} object
-     * @throws java.io.IOException java.io.IOException if any.
+     * @throws java.io.IOException java.io.IOException if any
      */
     public void write( Writer writer, ${root.name} ${rootLcapName} )
         throws java.io.IOException
@@ -117,7 +117,7 @@ public class ${className}
      *
      * @param stream a stream object
      * @param ${rootLcapName} a ${root.name} object
-     * @throws java.io.IOException java.io.IOException if any.
+     * @throws java.io.IOException java.io.IOException if any
      */
     public void write( OutputStream stream, ${root.name} ${rootLcapName} )
         throws java.io.IOException
@@ -273,15 +273,15 @@ public class ${className}
         }
     }
 
-    private <T> void writeProperties( String tagName, Properties props, XmlSerializer serializer )
+    private <T> void writeProperties( String tagName, Map<String, String> props, XmlSerializer serializer )
             throws IOException
     {
         if ( props != null && !props.isEmpty() )
         {
             serializer.startTag( NAMESPACE, tagName );
-            for ( Map.Entry<Object, Object> entry : props.entrySet() )
+            for ( Map.Entry<String, String> entry : props.entrySet() )
             {
-                writeTag( entry.getKey().toString(), null, entry.getValue().toString(), serializer );
+                writeTag( entry.getKey(), null, entry.getValue(), serializer );
             }
             serializer.endTag( NAMESPACE, tagName );
         }