o Refactored code

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1073703 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2011-02-23 11:47:12 +00:00
parent a8ce74df45
commit 40b6533b01
1 changed files with 14 additions and 20 deletions

View File

@ -461,17 +461,7 @@ public class LegacyRepositorySystem
for ( ArtifactRepository repository : repositories )
{
Mirror mirror = getMirror( repository, mirrors );
if ( mirror != null )
{
repository.setId( mirror.getId() );
repository.setUrl( mirror.getUrl() );
if ( StringUtils.isNotEmpty( mirror.getLayout() ) )
{
repository.setLayout( getLayout( mirror.getLayout() ) );
}
}
injectMirror( repository, mirror );
}
}
}
@ -504,17 +494,21 @@ public class LegacyRepositorySystem
for ( ArtifactRepository repository : repositories )
{
Mirror mirror = getMirror( session, repository );
injectMirror( repository, mirror );
}
}
}
if ( mirror != null )
{
repository.setId( mirror.getId() );
repository.setUrl( mirror.getUrl() );
private void injectMirror( ArtifactRepository repository, Mirror mirror )
{
if ( mirror != null )
{
repository.setId( mirror.getId() );
repository.setUrl( mirror.getUrl() );
if ( StringUtils.isNotEmpty( mirror.getLayout() ) )
{
repository.setLayout( getLayout( mirror.getLayout() ) );
}
}
if ( StringUtils.isNotEmpty( mirror.getLayout() ) )
{
repository.setLayout( getLayout( mirror.getLayout() ) );
}
}
}