splatch commented on a change in pull request #164: [MNG-6411] Improve 
readability of project list for resume option.
URL: https://github.com/apache/maven/pull/164#discussion_r187792949
 
 

 ##########
 File path: 
maven-core/src/main/java/org/apache/maven/graph/DefaultGraphBuilder.java
 ##########
 @@ -311,13 +311,29 @@ else if ( StringUtils.isNotEmpty( 
request.getMakeBehavior() ) )
             if ( !resumed )
             {
                 throw new MavenExecutionException( "Could not find project to 
resume reactor build from: " + selector
-                    + " vs " + projects, request.getPom() );
+                    + " vs " + formatProjects( projects ), request.getPom() );
             }
         }
 
         return result;
     }
 
+    private String formatProjects( List<MavenProject> projects )
+    {
+        StringBuilder projectNames = new StringBuilder();
+        for ( int index = 0, size = projects.size(); index < size; index++ )
+        {
+            MavenProject project = projects.get( index );
 
 Review comment:
   There is additional condition inside loop which appends a colon. This can’t 
be done without regular for loop as foreach doesn’t give a way to check if 
fetched element is actually the last one.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to