From ddd5c13075acc9b6ccaa22ed14fec72a5a184c3f Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Wed, 22 Jul 2009 09:21:11 +0000 Subject: [PATCH] o Generified code git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@796637 13f79535-47bb-0310-9956-ffa450edef68 --- .../AbstractArtifactResolutionException.java | 20 +++++++++---------- .../resolver/ArtifactNotFoundException.java | 4 ++-- .../resolver/ArtifactResolutionException.java | 5 +++-- .../project/DefaultModelBuildingListener.java | 2 +- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/maven-compat/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java b/maven-compat/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java index 9002c4e5db..f7fdc0553c 100644 --- a/maven-compat/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java +++ b/maven-compat/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java @@ -63,7 +63,7 @@ public class AbstractArtifactResolutionException String type, String classifier, List remoteRepositories, - List path ) + List path ) { this( message, groupId, artifactId, version, type, classifier, remoteRepositories, path, null ); } @@ -75,7 +75,7 @@ public class AbstractArtifactResolutionException String type, String classifier, List remoteRepositories, - List path, + List path, Throwable t ) { super( constructMessageBase( message, groupId, artifactId, version, type, remoteRepositories, path ), t ); @@ -150,7 +150,7 @@ public class AbstractArtifactResolutionException return this.path; } - public List getRemoteRepositories() + public List getRemoteRepositories() { return remoteRepositories; } @@ -160,7 +160,7 @@ public class AbstractArtifactResolutionException return originalMessage; } - protected static String constructArtifactPath( List path, + protected static String constructArtifactPath( List path, String indentation ) { StringBuilder sb = new StringBuilder(); @@ -172,7 +172,7 @@ public class AbstractArtifactResolutionException sb.append( "Path to dependency: " ); sb.append( LS ); int num = 1; - for ( Iterator i = path.iterator(); i.hasNext(); num++ ) + for ( Iterator i = path.iterator(); i.hasNext(); num++ ) { sb.append( indentation ); sb.append( "\t" ); @@ -191,8 +191,8 @@ public class AbstractArtifactResolutionException String artifactId, String version, String type, - List remoteRepositories, - List path ) + List remoteRepositories, + List path ) { StringBuilder sb = new StringBuilder(); @@ -206,9 +206,9 @@ public class AbstractArtifactResolutionException sb.append( "from the specified remote repositories:" ); sb.append( LS + " " ); - for ( Iterator i = new HashSet( remoteRepositories ).iterator(); i.hasNext(); ) + for ( Iterator i = new HashSet( remoteRepositories ).iterator(); i.hasNext(); ) { - ArtifactRepository remoteRepository = (ArtifactRepository) i.next(); + ArtifactRepository remoteRepository = i.next(); sb.append( remoteRepository.getId() ); sb.append( " (" ); @@ -247,7 +247,7 @@ public class AbstractArtifactResolutionException String type, String classifier, String downloadUrl, - List path ) + List path ) { StringBuilder sb = new StringBuilder( message ); diff --git a/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ArtifactNotFoundException.java b/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ArtifactNotFoundException.java index b156fa2822..0ef6d2bba1 100644 --- a/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ArtifactNotFoundException.java +++ b/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ArtifactNotFoundException.java @@ -47,7 +47,7 @@ public class ArtifactNotFoundException } public ArtifactNotFoundException( String message, String groupId, String artifactId, String version, String type, String classifier, List remoteRepositories, - String downloadUrl, List path, ResourceDoesNotExistException cause ) + String downloadUrl, List path, ResourceDoesNotExistException cause ) { super( constructMissingArtifactMessage( message, "", groupId, artifactId, version, type, classifier, downloadUrl, path ), groupId, artifactId, version, type, classifier, remoteRepositories, null, cause ); @@ -56,7 +56,7 @@ public class ArtifactNotFoundException } private ArtifactNotFoundException( String message, String groupId, String artifactId, String version, String type, String classifier, List remoteRepositories, - String downloadUrl, List path ) + String downloadUrl, List path ) { super( constructMissingArtifactMessage( message, "", groupId, artifactId, version, type, classifier, downloadUrl, path ), groupId, artifactId, version, type, classifier, remoteRepositories, null ); diff --git a/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionException.java b/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionException.java index 741381fea3..5321f1e289 100644 --- a/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionException.java +++ b/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionException.java @@ -31,8 +31,9 @@ import org.apache.maven.wagon.TransferFailedException; public class ArtifactResolutionException extends AbstractArtifactResolutionException { - public ArtifactResolutionException( String message, String groupId, String artifactId, String version, String type, String classifier, List remoteRepositories, List path, - Throwable t ) + public ArtifactResolutionException( String message, String groupId, String artifactId, String version, String type, + String classifier, List remoteRepositories, + List path, Throwable t ) { super( message, groupId, artifactId, version, type, classifier, remoteRepositories, path, t ); } diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultModelBuildingListener.java b/maven-core/src/main/java/org/apache/maven/project/DefaultModelBuildingListener.java index 3f07b5f2d7..68b7e58f35 100644 --- a/maven-core/src/main/java/org/apache/maven/project/DefaultModelBuildingListener.java +++ b/maven-core/src/main/java/org/apache/maven/project/DefaultModelBuildingListener.java @@ -59,7 +59,7 @@ class DefaultModelBuildingListener { throw new IllegalArgumentException( "project building request missing" ); } - this.projectBuildingRequest = projectBuildingRequest; + this.projectBuildingRequest = projectBuildingRequest; this.remoteRepositories = projectBuildingRequest.getRemoteRepositories(); this.pluginRepositories = projectBuildingRequest.getPluginArtifactRepositories(); }