mirror of https://github.com/apache/maven.git
[MNG-7291] Avoid String concatenation in loops (#572)
This commit is contained in:
parent
25796220ad
commit
b31f3aeef3
|
@ -229,7 +229,7 @@ public class MojoDescriptorCreator
|
||||||
resolvePluginVersion( plugin, session, project );
|
resolvePluginVersion( plugin, session, project );
|
||||||
}
|
}
|
||||||
|
|
||||||
return pluginManager.getMojoDescriptor( plugin, goal, project.getRemotePluginRepositories(),
|
return pluginManager.getMojoDescriptor( plugin, goal.toString(), project.getRemotePluginRepositories(),
|
||||||
session.getRepositorySession() );
|
session.getRepositorySession() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,29 +40,29 @@ public class NoPluginFoundForPrefixException
|
||||||
|
|
||||||
private static String format( LocalRepository localRepository, List<RemoteRepository> remoteRepositories )
|
private static String format( LocalRepository localRepository, List<RemoteRepository> remoteRepositories )
|
||||||
{
|
{
|
||||||
String repos = "[";
|
StringBuilder repos = new StringBuilder( "[" );
|
||||||
|
|
||||||
if ( localRepository != null )
|
if ( localRepository != null )
|
||||||
{
|
{
|
||||||
repos += localRepository.getId() + " (" + localRepository.getBasedir() + ")";
|
repos.append( localRepository.getId() ).append( " (" ).append( localRepository.getBasedir() ).append( ")" );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( remoteRepositories != null && !remoteRepositories.isEmpty() )
|
if ( remoteRepositories != null && !remoteRepositories.isEmpty() )
|
||||||
{
|
{
|
||||||
for ( RemoteRepository repository : remoteRepositories )
|
for ( RemoteRepository repository : remoteRepositories )
|
||||||
{
|
{
|
||||||
repos += ", ";
|
repos.append( ", " );
|
||||||
|
|
||||||
if ( repository != null )
|
if ( repository != null )
|
||||||
{
|
{
|
||||||
repos += repository.getId() + " (" + repository.getUrl() + ")";
|
repos.append( repository.getId() ).append( " (" ).append( repository.getUrl() ).append( ")" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
repos += "]";
|
repos.append( "]" );
|
||||||
|
|
||||||
return repos;
|
return repos.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1556,13 +1556,15 @@ public class DefaultModelBuilder
|
||||||
|
|
||||||
if ( importIds.contains( imported ) )
|
if ( importIds.contains( imported ) )
|
||||||
{
|
{
|
||||||
String message = "The dependencies of type=pom and with scope=import form a cycle: ";
|
StringBuilder message =
|
||||||
|
new StringBuilder( "The dependencies of type=pom and with scope=import form a cycle: " );
|
||||||
for ( String modelId : importIds )
|
for ( String modelId : importIds )
|
||||||
{
|
{
|
||||||
message += modelId + " -> ";
|
message.append( modelId ).append( " -> " );
|
||||||
}
|
}
|
||||||
message += imported;
|
message.append( imported );
|
||||||
problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ).setMessage( message ) );
|
problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ).setMessage(
|
||||||
|
message.toString() ) );
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue