maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r709731 - /maven/plugins/trunk/maven-toolchains-plugin/src/main/java/org/apache/maven/plugin/toolchain/ToolchainMojo.java
Date Sat, 01 Nov 2008 17:38:11 GMT
Author: hboutemy
Date: Sat Nov  1 10:38:11 2008
New Revision: 709731

URL: http://svn.apache.org/viewvc?rev=709731&view=rev
Log:
use StringBuffer to build message

Modified:
    maven/plugins/trunk/maven-toolchains-plugin/src/main/java/org/apache/maven/plugin/toolchain/ToolchainMojo.java

Modified: maven/plugins/trunk/maven-toolchains-plugin/src/main/java/org/apache/maven/plugin/toolchain/ToolchainMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-toolchains-plugin/src/main/java/org/apache/maven/plugin/toolchain/ToolchainMojo.java?rev=709731&r1=709730&r2=709731&view=diff
==============================================================================
--- maven/plugins/trunk/maven-toolchains-plugin/src/main/java/org/apache/maven/plugin/toolchain/ToolchainMojo.java
(original)
+++ maven/plugins/trunk/maven-toolchains-plugin/src/main/java/org/apache/maven/plugin/toolchain/ToolchainMojo.java
Sat Nov  1 10:38:11 2008
@@ -88,9 +88,8 @@
                     {
                         if ( tcs[i].matchesRequirements( params ) )
                         {
-                            getLog(  ).info( "Toolchain (" + type + ") matched:" + tcs[i]
);
-                            toolchainManager.storeToolchainToBuildContext( tcs[i],
-                                session );
+                            getLog().info( "Toolchain (" + type + ") matched:" + tcs[i] );
+                            toolchainManager.storeToolchainToBuildContext( tcs[i], session
);
                             matched = true;
                             break;
                         }
@@ -102,34 +101,36 @@
                 }
                 catch ( MisconfiguredToolchainException ex )
                 {
-                    throw new MojoExecutionException( "Misconfigured toolchains.",
-                        ex );
+                    throw new MojoExecutionException( "Misconfigured toolchains.", ex );
                 }
             }
             if ( !nonMatchedTypes.isEmpty() )
             {
                 //TODO add the default toolchain instance if defined??
-                String str = "Cannot find matching toolchain definitions for the following
toolchain types:";
+                StringBuffer buff = new StringBuffer();
+                buff.append( "Cannot find matching toolchain definitions for the following
toolchain types:" );
                 Iterator it = nonMatchedTypes.iterator();
                 while ( it.hasNext() )
                 {
                     String type = (String) it.next();
-                    str = str + "\n" + type;
+                    buff.append( '\n' );
+                    buff.append( type );
                     Map params = toolchains.getParams( type );
                     if ( params.size() > 0 )
                     {
                         Iterator it2 = params.keySet().iterator();
-                        str = str + " [";
+                        buff.append( " [" );
                         while ( it2.hasNext() )
                         {
                             String string = (String) it2.next();
-                            str = str + " " + string + "='" + params.get( string ) + "' ";
+                            buff.append( " " + string + "='" + params.get( string ) + "'
" );
                         }
-                        str = str + "]";
+                        buff.append( ']' );
                     }
                 }
-                getLog().error( str );
-                throw new MojoFailureException( str + "\nPlease make sure you define the
required toolchains in your ~/.m2/toolchains.xml file." );
+                getLog().error( buff.toString() );
+                throw new MojoFailureException( buff.toString()
+                		+ "\nPlease make sure you define the required toolchains in your ~/.m2/toolchains.xml
file." );
             }
         }
         else



Mime
View raw message