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 2022/01/06 20:33:10 UTC

[maven] branch MNG-7263 updated (363a528 -> 1053bf4)

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

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


 discard 363a528  [MNG-7263] improve AbstractLifecycleProvider
     new 1053bf4  [MNG-7263] improve AbstractLifecycleProvider

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   (363a528)
            \
             N -- N -- N   refs/heads/MNG-7263 (1053bf4)

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:
 .../org/apache/maven/lifecycle/providers/AbstractLifecycleProvider.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

[maven] 01/01: [MNG-7263] improve AbstractLifecycleProvider

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

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

commit 1053bf4776dc24f59e7fb6e3772ad09839120400
Author: Hervé Boutemy <hb...@apache.org>
AuthorDate: Thu Jan 6 21:21:34 2022 +0100

    [MNG-7263] improve AbstractLifecycleProvider
---
 .../lifecycle/providers/AbstractLifecycleProvider.java    | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/AbstractLifecycleProvider.java b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/AbstractLifecycleProvider.java
index eb80a58..b69f5aa 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/AbstractLifecycleProvider.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/AbstractLifecycleProvider.java
@@ -41,11 +41,18 @@ public abstract class AbstractLifecycleProvider
         HashMap<String, LifecyclePhase> defaultBindings = null;
         if ( pluginBindings != null )
         {
-            int len = pluginBindings.length;
-            defaultBindings = new HashMap<>();
-            for ( int i = 0; i < len; i++ )
+            final int len = pluginBindings.length;
+
+            if ( len < 1 || len % 2 != 0 )
+            {
+                throw new IllegalArgumentException( "Plugin bindings must have more than 0, even count of elements" );
+            }
+
+            defaultBindings = new HashMap<>( len / 2 );
+
+            for ( int i = 0; i < len; i += 2 )
             {
-                defaultBindings.put( pluginBindings[i++], new LifecyclePhase( pluginBindings[i] ) );
+                defaultBindings.put( pluginBindings[i], new LifecyclePhase( pluginBindings[i + 1] ) );
             }
         }