o Replaced usage of StringBuffer with StringBuilder

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@795584 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-07-19 18:20:09 +00:00
parent 12ea9f5244
commit 01f7692db0
33 changed files with 49 additions and 49 deletions

View File

@ -224,14 +224,14 @@ public class DefaultArtifact
public String getDependencyConflictId()
{
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder( 128 );
sb.append( getGroupId() );
sb.append( ":" );
appendArtifactTypeClassifierString( sb );
return sb.toString();
}
private void appendArtifactTypeClassifierString( StringBuffer sb )
private void appendArtifactTypeClassifierString( StringBuilder sb )
{
sb.append( getArtifactId() );
sb.append( ":" );
@ -276,7 +276,7 @@ public class DefaultArtifact
public String toString()
{
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
if ( getGroupId() != null )
{
sb.append( getGroupId() );

View File

@ -167,7 +167,7 @@ public class DefaultArtifactRepository
public String toString()
{
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append( " id: " ).append( getId() ).append( "\n" );
sb.append( " url: " ).append( getUrl() ).append( "\n" );

View File

@ -124,7 +124,7 @@ public class MavenArtifactRepository
public String toString()
{
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append( " id: " ).append( getId() ).append( "\n" );
sb.append( " url: " ).append( getUrl() ).append( "\n" );

View File

@ -47,7 +47,7 @@ public class DefaultRepositoryLayout
{
ArtifactHandler artifactHandler = artifact.getArtifactHandler();
StringBuffer path = new StringBuffer();
StringBuilder path = new StringBuilder( 128 );
path.append( formatAsDirectory( artifact.getGroupId() ) ).append( PATH_SEPARATOR );
path.append( artifact.getArtifactId() ).append( PATH_SEPARATOR );
@ -75,7 +75,7 @@ public class DefaultRepositoryLayout
private String pathOfRepositoryMetadata( ArtifactMetadata metadata,
String filename )
{
StringBuffer path = new StringBuffer();
StringBuilder path = new StringBuilder( 128 );
path.append( formatAsDirectory( metadata.getGroupId() ) ).append( PATH_SEPARATOR );
if ( !metadata.storedInGroupDirectory() )

View File

@ -29,7 +29,7 @@ public class FlatRepositoryLayout
{
ArtifactHandler artifactHandler = artifact.getArtifactHandler();
StringBuffer path = new StringBuffer();
StringBuilder path = new StringBuilder( 128 );
path.append( artifact.getArtifactId() ).append( ARTIFACT_SEPARATOR ).append( artifact.getVersion() );
@ -54,7 +54,7 @@ public class FlatRepositoryLayout
private String pathOfRepositoryMetadata( String filename )
{
StringBuffer path = new StringBuffer();
StringBuilder path = new StringBuilder( 128 );
path.append( filename );

View File

@ -43,7 +43,7 @@ public class LegacyRepositoryLayout
{
ArtifactHandler artifactHandler = artifact.getArtifactHandler();
StringBuffer path = new StringBuffer();
StringBuilder path = new StringBuilder( 128 );
path.append( artifact.getGroupId() ).append( '/' );
path.append( artifactHandler.getDirectory() ).append( '/' );
@ -71,7 +71,7 @@ public class LegacyRepositoryLayout
private String pathOfRepositoryMetadata( ArtifactMetadata metadata,
String filename )
{
StringBuffer path = new StringBuffer();
StringBuilder path = new StringBuilder( 128 );
path.append( metadata.getGroupId() ).append( PATH_SEPARATOR ).append( "poms" ).append( PATH_SEPARATOR );

View File

@ -205,7 +205,7 @@ public abstract class AbstractRepositoryMetadata
public String extendedToString()
{
StringBuffer buffer = new StringBuffer();
StringBuilder buffer = new StringBuilder();
buffer.append( "\nRepository Metadata\n--------------------------" );
buffer.append( "\nGroupId: " ).append( getGroupId() );

View File

@ -163,7 +163,7 @@ public class AbstractArtifactResolutionException
protected static String constructArtifactPath( List path,
String indentation )
{
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
if ( path != null )
{
@ -194,7 +194,7 @@ public class AbstractArtifactResolutionException
List remoteRepositories,
List path )
{
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append( message );
sb.append( LS );
@ -249,7 +249,7 @@ public class AbstractArtifactResolutionException
String downloadUrl,
List path )
{
StringBuffer sb = new StringBuffer( message );
StringBuilder sb = new StringBuilder( message );
if ( !"pom".equals( type ) )
{

View File

@ -171,7 +171,7 @@ public class ArtifactResolutionRequest
public String toString()
{
StringBuffer sb = new StringBuffer()
StringBuilder sb = new StringBuilder()
.append( "REQUEST: " ).append( "\n" )
.append( "artifact: " ).append( artifact ).append( "\n" )
.append( artifactDependencies ).append( "\n" )

View File

@ -325,7 +325,7 @@ public class ArtifactResolutionResult
public String toString()
{
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
if ( artifacts != null )
{

View File

@ -84,7 +84,7 @@ public class MultipleArtifactsNotFoundException
private static String constructMessage( List<Artifact> artifacts )
{
StringBuffer buffer = new StringBuffer( "Missing:\n" );
StringBuilder buffer = new StringBuilder( "Missing:\n" );
buffer.append( "----------\n" );

View File

@ -303,7 +303,7 @@ public class ComparableVersion
public String toString()
{
StringBuffer buffer = new StringBuffer( "(" );
StringBuilder buffer = new StringBuilder( "(" );
for( Iterator iter = iterator(); iter.hasNext(); )
{
buffer.append( iter.next() );

View File

@ -208,7 +208,7 @@ public class DefaultArtifactVersion
@Override
public String toString()
{
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
if ( majorVersion != null )
{
buf.append( majorVersion );

View File

@ -37,7 +37,7 @@ public class ManagedVersionMap
public String toString()
{
StringBuffer buffer = new StringBuffer( "ManagedVersionMap (" + size() + " entries)\n" );
StringBuilder buffer = new StringBuilder( "ManagedVersionMap (" + size() + " entries)\n" );
Iterator iter = keySet().iterator();
while ( iter.hasNext() )
{

View File

@ -181,7 +181,7 @@ public class Restriction
public String toString()
{
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
buf.append( isLowerBoundInclusive() ? "[" : "(" );
if ( getLowerBound() != null )

View File

@ -504,7 +504,7 @@ public class VersionRange
}
else
{
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
for ( Iterator i = restrictions.iterator(); i.hasNext(); )
{
Restriction r = (Restriction) i.next();

View File

@ -737,7 +737,7 @@ public class DefaultModelInheritanceAssembler
}
}
StringBuffer cleanedPath = new StringBuffer();
StringBuilder cleanedPath = new StringBuilder();
while ( !pathElements.isEmpty() )
{

View File

@ -73,7 +73,7 @@ public class ModelValidationResult
return indentation + "There were no validation errors.";
}
StringBuffer message = new StringBuffer();
StringBuilder message = new StringBuilder();
// if ( messages.size() == 1 )
// {

View File

@ -134,7 +134,7 @@ public class MetadataResolutionRequest
public String toString()
{
StringBuffer sb = new StringBuffer()
StringBuilder sb = new StringBuilder()
.append( "REQUEST: " ).append( "\n" )
.append( "artifact: " ).append( mad ).append( "\n" )
.append( artifactDependencies ).append( "\n" )

View File

@ -326,7 +326,7 @@ public class MetadataResolutionResult
public String toString()
{
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
if ( artifacts != null )
{

View File

@ -352,7 +352,7 @@ public class DefaultUpdateCheckManager
public File getTouchfile( Artifact artifact )
{
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append( artifact.getArtifactId() );
sb.append( '-' ).append( artifact.getBaseVersion() );
if ( artifact.getClassifier() != null )

View File

@ -54,7 +54,7 @@ public abstract class AbstractArtifactMetadata
public String extendedToString()
{
StringBuffer buffer = new StringBuffer();
StringBuilder buffer = new StringBuilder();
buffer.append( "\nArtifact Metadata\n--------------------------" );
buffer.append( "\nGroupId: " ).append( getGroupId() );

View File

@ -455,7 +455,7 @@ public class DefaultLifecycleExecutor
private String executionDescription( MojoExecution me, MavenProject project )
{
PluginDescriptor pd = me.getMojoDescriptor().getPluginDescriptor();
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder( 128 );
sb.append( "Executing " + pd.getArtifactId() + "[" + pd.getVersion() + "]: " + me.getMojoDescriptor().getGoal() + " on " + project.getArtifactId() );
return sb.toString();
}
@ -1217,7 +1217,7 @@ public class DefaultLifecycleExecutor
if ( warnOfDeprecation )
{
StringBuffer buffer = new StringBuffer();
StringBuilder buffer = new StringBuilder( 128 );
buffer.append( "In mojo: " ).append( mojoDescriptor.getGoal() ).append( ", parameter: " ).append( param.getName() );
if ( param.getAlias() != null )
@ -1338,7 +1338,7 @@ public class DefaultLifecycleExecutor
// Make sure the parameter is either editable/configurable, or else is NOT specified in the POM
if ( !parameter.isEditable() )
{
StringBuffer errorMessage = new StringBuffer().append( "ERROR: Cannot override read-only parameter: " );
StringBuilder errorMessage = new StringBuilder( 128 ).append( "ERROR: Cannot override read-only parameter: " );
errorMessage.append( key );
errorMessage.append( " in goal: " ).append( goal.getFullGoalName() );

View File

@ -67,7 +67,7 @@ public class DebugConfigurationListener
if ( obj != null && obj.getClass().isArray() )
{
int n = Array.getLength( obj );
StringBuffer buf = new StringBuffer( 256 );
StringBuilder buf = new StringBuilder( 256 );
buf.append( '[' );
for ( int i = 0; i < n; i++ )
{

View File

@ -612,7 +612,7 @@ public class DefaultPluginManager
logger.fatalError( configurator.getClass().getName() + "#configureComponent(...) caused a linkage error (" + e.getClass().getName() + ") and may be out-of-date. Check the realms:" );
ClassRealm pluginRealm = mojoDescriptor.getPluginDescriptor().getClassRealm();
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append( "Plugin realm = " + pluginRealm.getId() ).append( '\n' );
for ( int i = 0; i < pluginRealm.getURLs().length; i++ )
{
@ -625,7 +625,7 @@ public class DefaultPluginManager
logger.fatalError( sb.toString() );
ClassRealm containerRealm = container.getContainerRealm();
sb = new StringBuffer();
sb = new StringBuilder();
sb.append( "Container realm = " + containerRealm.getId() ).append( '\n' );
for ( int i = 0; i < containerRealm.getURLs().length; i++ )
{

View File

@ -102,7 +102,7 @@ public class MojoExecution
public String identify()
{
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder( 256 );
sb.append( executionId );
sb.append( configuration.toString() );

View File

@ -55,7 +55,7 @@ public class PluginParameterException
}
private static void decomposeParameterIntoUserInstructions( MojoDescriptor mojo, Parameter param,
StringBuffer messageBuffer )
StringBuilder messageBuffer )
{
String expression = param.getExpression();
@ -90,7 +90,7 @@ public class PluginParameterException
public String buildDiagnosticMessage()
{
StringBuffer messageBuffer = new StringBuffer();
StringBuilder messageBuffer = new StringBuilder( 256 );
List params = getParameters();
MojoDescriptor mojo = getMojoDescriptor();

View File

@ -1691,7 +1691,7 @@ public class MavenProject
@Override
public String toString()
{
StringBuffer sb = new StringBuffer( 30 );
StringBuilder sb = new StringBuilder( 128 );
sb.append( "MavenProject: " );
sb.append( getGroupId() );
sb.append( ":" );

View File

@ -93,7 +93,7 @@ public final class SettingsValidationResult
return indentation + "There were no validation errors.";
}
StringBuffer message = new StringBuffer();
StringBuilder message = new StringBuilder( 256 );
// if ( messages.size() == 1 )
// {

View File

@ -663,7 +663,7 @@
public String toString()
{
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder( 128 );
sb.append( "Mirror[" );
sb.append( "id=" ).append( this.getId() );
sb.append( ",mirrorOf=" ).append( mirrorOf );

View File

@ -1689,13 +1689,13 @@ public class PomConstructionTest
assertEquals( expected, pom.getValue( expression ) );
}
private static String createPath(List<String> elements)
private static String createPath( List<String> elements )
{
StringBuffer buffer = new StringBuffer();
for(String s : elements)
StringBuilder buffer = new StringBuilder( 256 );
for ( String s : elements )
{
buffer.append(s).append(File.separator);
buffer.append( s ).append( File.separator );
}
return buffer.toString().substring(0, buffer.toString().length() - 1);
return buffer.toString().substring( 0, buffer.toString().length() - 1 );
}
}

View File

@ -152,7 +152,7 @@ public class CLIManager
{
List<String> cleaned = new ArrayList<String>();
StringBuffer currentArg = null;
StringBuilder currentArg = null;
for ( int i = 0; i < args.length; i++ )
{
@ -170,7 +170,7 @@ public class CLIManager
}
// start building an argument here.
currentArg = new StringBuffer( arg.substring( 1 ) );
currentArg = new StringBuilder( arg.substring( 1 ) );
addedToBuffer = true;
}

View File

@ -615,7 +615,7 @@ public class MavenModelMerger
}
}
StringBuffer cleanedPath = new StringBuffer();
StringBuilder cleanedPath = new StringBuilder( 128 );
while ( !pathElements.isEmpty() )
{