You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2022/05/29 08:46:45 UTC

[maven] 01/01: Address comments

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

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

commit 3a817f9f1b20308389a5a757433991c34ca6b107
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Sat May 28 16:31:11 2022 +0200

    Address comments
---
 .../java/org/apache/maven/internal/MultilineMessageHelper.java | 10 +++++-----
 .../apache/maven/lifecycle/internal/builder/BuilderCommon.java |  8 ++++----
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/maven-core/src/main/java/org/apache/maven/internal/MultilineMessageHelper.java b/maven-core/src/main/java/org/apache/maven/internal/MultilineMessageHelper.java
index 9fd43252e..da158295b 100644
--- a/maven-core/src/main/java/org/apache/maven/internal/MultilineMessageHelper.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/MultilineMessageHelper.java
@@ -41,7 +41,7 @@ public class MultilineMessageHelper
     public static List<String> format( String... lines )
     {
         int size = DEFAULT_MAX_SIZE;
-        int rem = size - 4; // 4 chars = 2 box_char + 2 spaces
+        int remainder = size - 4; // 4 chars = 2 box_char + 2 spaces
         List<String> result = new ArrayList<>();
         StringBuilder sb = new StringBuilder( size );
         // first line
@@ -52,12 +52,12 @@ public class MultilineMessageHelper
         for ( String line : lines )
         {
             sb.setLength( 0 );
-            String[] words = line.split( " " );
+            String[] words = line.split( "\\s+" );
             for ( String word : words )
             {
-                if ( sb.length() >= rem - word.length() - ( sb.length() > 0 ? 1 : 0 ) )
+                if ( sb.length() >= remainder - word.length() - ( sb.length() > 0 ? 1 : 0 ) )
                 {
-                    repeat( sb, ' ', rem - sb.length() );
+                    repeat( sb, ' ', remainder - sb.length() );
                     result.add( BOX_CHAR + " " + sb + " " + BOX_CHAR );
                     sb.setLength( 0 );
                 }
@@ -68,7 +68,7 @@ public class MultilineMessageHelper
                 sb.append( word );
             }
 
-            while ( sb.length() < rem )
+            while ( sb.length() < remainder )
             {
                 sb.append( ' ' );
             }
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java
index 52b05cb94..5415413af 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java
@@ -144,7 +144,7 @@ public class BuilderCommon
             {
                 for ( String s : MultilineMessageHelper.format(
                         "Your build is requesting parallel execution, but this project contains the following "
-                                + "plugin(s) that have goals not marked as @threadSafe to support parallel execution.",
+                                + "plugin(s) that have goals not marked as thread-safe to support parallel execution.",
                         "While this /may/ work fine, please look for plugin updates and/or "
                                 + "request plugins be made thread-safe.",
                         "If reporting an issue, report it against the plugin in question, not against Apache Maven." ) )
@@ -154,7 +154,7 @@ public class BuilderCommon
                 if ( logger.isDebugEnabled() )
                 {
                     final Set<MojoDescriptor> unsafeGoals = executionPlan.getNonThreadSafeMojos();
-                    logger.warn( "The following goals are not marked as @threadSafe in " + project.getName() + ":" );
+                    logger.warn( "The following goals are not marked as thread-safe in " + project.getName() + ":" );
                     for ( MojoDescriptor unsafeGoal : unsafeGoals )
                     {
                         logger.warn( "  " + unsafeGoal.getId() );
@@ -162,14 +162,14 @@ public class BuilderCommon
                 }
                 else
                 {
-                    logger.warn( "The following plugins are not marked as @threadSafe in " + project.getName() + ":" );
+                    logger.warn( "The following plugins are not marked as thread-safe in " + project.getName() + ":" );
                     for ( Plugin unsafePlugin : unsafePlugins )
                     {
                         logger.warn( "  " + unsafePlugin.getId() );
                     }
                     logger.warn( "" );
                     logger.warn( "Enable verbose output (-X) to see precisely which goals are not marked as"
-                            + " @threadSafe." );
+                            + " thread-safe." );
                 }
                 logger.warn( MultilineMessageHelper.separatorLine() );
             }