maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ogusa...@apache.org
Subject svn commit: r704773 - in /maven/mercury/trunk/mercury-repo: mercury-repo-api/src/main/java/org/apache/maven/mercury/repository/api/ mercury-repo-virtual/src/main/java/org/apache/maven/mercury/repository/virtual/
Date Wed, 15 Oct 2008 03:55:02 GMT
Author: ogusakov
Date: Tue Oct 14 20:55:02 2008
New Revision: 704773

URL: http://svn.apache.org/viewvc?rev=704773&view=rev
Log:
virtual getVersions() aggregates results correctly

Modified:
    maven/mercury/trunk/mercury-repo/mercury-repo-api/src/main/java/org/apache/maven/mercury/repository/api/ArtifactBasicResults.java
    maven/mercury/trunk/mercury-repo/mercury-repo-virtual/src/main/java/org/apache/maven/mercury/repository/virtual/VirtualRepositoryReader.java

Modified: maven/mercury/trunk/mercury-repo/mercury-repo-api/src/main/java/org/apache/maven/mercury/repository/api/ArtifactBasicResults.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-repo/mercury-repo-api/src/main/java/org/apache/maven/mercury/repository/api/ArtifactBasicResults.java?rev=704773&r1=704772&r2=704773&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-repo/mercury-repo-api/src/main/java/org/apache/maven/mercury/repository/api/ArtifactBasicResults.java
(original)
+++ maven/mercury/trunk/mercury-repo/mercury-repo-api/src/main/java/org/apache/maven/mercury/repository/api/ArtifactBasicResults.java
Tue Oct 14 20:55:02 2008
@@ -83,10 +83,21 @@
     return res;
   }
   
+  /**
+   * add results if they are not there yet
+   * 
+   * @param query
+   * @param result
+   */
   public void add( ArtifactBasicMetadata query, List<ArtifactBasicMetadata> result
)
   {
     List<ArtifactBasicMetadata> res = getOrCreate( query );
-    res.addAll( result );
+    for( ArtifactBasicMetadata r : result )
+    {
+      if( res.contains( r ) )
+        continue;
+      res.add( r );
+    }
   }
   
   public void add( ArtifactBasicMetadata query, ArtifactBasicMetadata result )

Modified: maven/mercury/trunk/mercury-repo/mercury-repo-virtual/src/main/java/org/apache/maven/mercury/repository/virtual/VirtualRepositoryReader.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-repo/mercury-repo-virtual/src/main/java/org/apache/maven/mercury/repository/virtual/VirtualRepositoryReader.java?rev=704773&r1=704772&r2=704773&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-repo/mercury-repo-virtual/src/main/java/org/apache/maven/mercury/repository/virtual/VirtualRepositoryReader.java
(original)
+++ maven/mercury/trunk/mercury-repo/mercury-repo-virtual/src/main/java/org/apache/maven/mercury/repository/virtual/VirtualRepositoryReader.java
Tue Oct 14 20:55:02 2008
@@ -220,7 +220,7 @@
             }
           }
           
-          if( rorRes == null )
+          if( Util.isEmpty( rorRes ) )
             continue;
           
           for( ArtifactBasicMetadata bmd : rorRes )



Mime
View raw message