You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2009/07/22 11:31:59 UTC
svn commit: r796641 -
/maven/components/trunk/maven-compat/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java
Author: bentmann
Date: Wed Jul 22 09:31:58 2009
New Revision: 796641
URL: http://svn.apache.org/viewvc?rev=796641&view=rev
Log:
o Tweaked exception message to be more presice with respect to remote repos
- First, don't eliminate repos with duplicate ids. Duplicate repos should have been merged up-front, if they weren't this is a bug and should be apparent in the diagnostic output
- Second, be explicit about the case where no repos are defined to distinguish that from the case where the exception creator did not know the repos (==null)
Modified:
maven/components/trunk/maven-compat/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java
Modified: maven/components/trunk/maven-compat/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-compat/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java?rev=796641&r1=796640&r2=796641&view=diff
==============================================================================
--- maven/components/trunk/maven-compat/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java (original)
+++ maven/components/trunk/maven-compat/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java Wed Jul 22 09:31:58 2009
@@ -19,7 +19,6 @@
* under the License.
*/
-import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@@ -200,13 +199,18 @@
sb.append( LS );
sb.append( " " + groupId + ":" + artifactId + ":" + type + ":" + version );
sb.append( LS );
- if ( remoteRepositories != null && !remoteRepositories.isEmpty() )
+ if ( remoteRepositories != null )
{
sb.append( LS );
sb.append( "from the specified remote repositories:" );
sb.append( LS + " " );
- for ( Iterator<ArtifactRepository> i = new HashSet<ArtifactRepository>( remoteRepositories ).iterator(); i.hasNext(); )
+ if ( remoteRepositories.isEmpty() )
+ {
+ sb.append( "(none)" );
+ }
+
+ for ( Iterator<ArtifactRepository> i = remoteRepositories.iterator(); i.hasNext(); )
{
ArtifactRepository remoteRepository = i.next();
@@ -229,7 +233,7 @@
sb.append( ")" );
if ( i.hasNext() )
{
- sb.append( ",\n " );
+ sb.append( "," ).append( LS ).append( " " );
}
}
}