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 2013/05/08 21:42:08 UTC

svn commit: r1480420 - /maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/AbstractDeployMojo.java

Author: hboutemy
Date: Wed May  8 19:42:07 2013
New Revision: 1480420

URL: http://svn.apache.org/r1480420
Log:
avoid usually unused temporary String creation

Modified:
    maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/AbstractDeployMojo.java

Modified: maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/AbstractDeployMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/AbstractDeployMojo.java?rev=1480420&r1=1480419&r2=1480420&view=diff
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/AbstractDeployMojo.java (original)
+++ maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/AbstractDeployMojo.java Wed May  8 19:42:07 2013
@@ -775,33 +775,35 @@ public abstract class AbstractDeployMojo
     protected static Site getSite( final MavenProject project )
         throws MojoExecutionException
     {
-        final String name =
-            project.getName() + " (" + project.getGroupId() + ":" + project.getArtifactId() + ":" + project.getVersion()
-                + ")";
-
         final DistributionManagement distributionManagement = project.getDistributionManagement();
 
         if ( distributionManagement == null )
         {
-            throw new MojoExecutionException( "Missing distribution management in project " + name );
+            throw new MojoExecutionException( "Missing distribution management in project " + getFullName( project ) );
         }
 
         final Site site = distributionManagement.getSite();
 
         if ( site == null )
         {
-            throw new MojoExecutionException(
-                "Missing site information in the distribution management of the project " + name );
+            throw new MojoExecutionException( "Missing site information in the distribution management of the project "
+                + getFullName( project ) );
         }
 
         if ( site.getUrl() == null || site.getId() == null )
         {
-            throw new MojoExecutionException( "Missing site data: specify url and id for project " + name );
+            throw new MojoExecutionException( "Missing site data: specify url and id for project "
+                + getFullName( project ) );
         }
 
         return site;
     }
 
+    private static String getFullName( MavenProject project )
+    {
+        return project.getName() + " (" + project.getGroupId() + ':' + project.getArtifactId() + ':'
+            + project.getVersion() + ')';
+    }
     /**
      * Extract the distributionManagement site of the top level parent of the given MavenProject.
      * This climbs up the project hierarchy and returns the site of the last project