maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rfscho...@apache.org
Subject svn commit: r1615373 - /maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PurgeLocalRepositoryMojo.java
Date Sat, 02 Aug 2014 22:06:33 GMT
Author: rfscholte
Date: Sat Aug  2 22:06:33 2014
New Revision: 1615373

URL: http://svn.apache.org/r1615373
Log:
Improve performance: don't concatenate Strings using + in a loop

Modified:
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PurgeLocalRepositoryMojo.java

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PurgeLocalRepositoryMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PurgeLocalRepositoryMojo.java?rev=1615373&r1=1615372&r2=1615373&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PurgeLocalRepositoryMojo.java
(original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PurgeLocalRepositoryMojo.java
Sat Aug  2 22:06:33 2014
@@ -627,14 +627,14 @@ public class PurgeLocalRepositoryMojo
 
         if ( missingArtifacts.size() > 0 )
         {
-            String message = "required artifacts missing:\n";
+            StringBuffer message = new StringBuffer( "required artifacts missing:\n" );
             for ( Artifact missingArtifact : missingArtifacts )
             {
-                message += "  " + missingArtifact.getId() + "\n";
+                message.append( "  " ).append( missingArtifact.getId() ).append( '\n' );
             }
-            message += "\nfor the artifact:";
+            message.append( "\nfor the artifact:" );
 
-            throw new ArtifactResolutionException( message, project.getArtifact(),
+            throw new ArtifactResolutionException( message.toString(), project.getArtifact(),
                                                    project.getRemoteArtifactRepositories()
);
         }
     }



Mime
View raw message