Return-Path: Delivered-To: apmail-maven-commits-archive@www.apache.org Received: (qmail 65468 invoked from network); 1 Nov 2008 17:39:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Nov 2008 17:39:02 -0000 Received: (qmail 73124 invoked by uid 500); 1 Nov 2008 17:39:08 -0000 Delivered-To: apmail-maven-commits-archive@maven.apache.org Received: (qmail 73065 invoked by uid 500); 1 Nov 2008 17:39:08 -0000 Mailing-List: contact commits-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@maven.apache.org Delivered-To: mailing list commits@maven.apache.org Received: (qmail 73056 invoked by uid 99); 1 Nov 2008 17:39:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Nov 2008 10:39:08 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Nov 2008 17:38:00 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id B9EF9238899D; Sat, 1 Nov 2008 10:38:11 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@maven.apache.org From: hboutemy@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081101173811.B9EF9238899D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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