From 8d90d7cabc1828fe82b2a5cceb52068cd04ecc85 Mon Sep 17 00:00:00 2001 From: Jason van Zyl Date: Mon, 15 Dec 2008 03:51:38 +0000 Subject: [PATCH] o starting to add generics git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@726614 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/maven/DefaultMavenTools.java | 17 +++++++---------- .../main/java/org/apache/maven/MavenTools.java | 2 +- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/maven-project/src/main/java/org/apache/maven/DefaultMavenTools.java b/maven-project/src/main/java/org/apache/maven/DefaultMavenTools.java index 403dee4821..af0edd401f 100644 --- a/maven-project/src/main/java/org/apache/maven/DefaultMavenTools.java +++ b/maven-project/src/main/java/org/apache/maven/DefaultMavenTools.java @@ -78,15 +78,13 @@ public class DefaultMavenTools // but just trying to collect it all in one place right now. // ---------------------------------------------------------------------------- - public List buildArtifactRepositories( List repositories ) + public List buildArtifactRepositories( List repositories ) throws InvalidRepositoryException { - List repos = new ArrayList(); + List repos = new ArrayList(); - for ( Iterator i = repositories.iterator(); i.hasNext(); ) + for( Repository mavenRepo : repositories ) { - Repository mavenRepo = (Repository) i.next(); - ArtifactRepository artifactRepo = buildArtifactRepository( mavenRepo ); if ( !repos.contains( artifactRepo ) ) @@ -94,6 +92,7 @@ public class DefaultMavenTools repos.add( artifactRepo ); } } + return repos; } @@ -105,8 +104,7 @@ public class DefaultMavenTools String id = repo.getId(); String url = repo.getUrl(); - return artifactRepositoryFactory.createDeploymentArtifactRepository( id, url, repo.getLayout(), - repo.isUniqueVersion() ); + return artifactRepositoryFactory.createDeploymentArtifactRepository( id, url, repo.getLayout(), repo.isUniqueVersion() ); } else { @@ -207,8 +205,7 @@ public class DefaultMavenTools return url; } - public ArtifactRepository createRepository( String url, - String repositoryId ) + public ArtifactRepository createRepository( String url, String repositoryId ) { // snapshots vs releases // offline = to turning the update policy off @@ -291,7 +288,7 @@ public class DefaultMavenTools } } - public List buildArtifactRepositories( Model model ) + public List buildArtifactRepositories( Model model ) throws ProjectBuildingException { try diff --git a/maven-project/src/main/java/org/apache/maven/MavenTools.java b/maven-project/src/main/java/org/apache/maven/MavenTools.java index ffad638af9..0e462bbb72 100644 --- a/maven-project/src/main/java/org/apache/maven/MavenTools.java +++ b/maven-project/src/main/java/org/apache/maven/MavenTools.java @@ -41,7 +41,7 @@ public interface MavenTools // Methods taken from ProjectUtils // ---------------------------------------------------------------------------- - List buildArtifactRepositories( List repositories ) + List buildArtifactRepositories( List repositories ) throws InvalidRepositoryException; ArtifactRepository buildDeploymentArtifactRepository( DeploymentRepository repo )