ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maart...@apache.org
Subject svn commit: r1222927 - /ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractPatternsBasedResolver.java
Date Sat, 24 Dec 2011 07:22:53 GMT
Author: maartenc
Date: Sat Dec 24 07:22:52 2011
New Revision: 1222927

URL: http://svn.apache.org/viewvc?rev=1222927&view=rev
Log:
FIX: Infinite loop in latest-compatible conflict manager

Modified:
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractPatternsBasedResolver.java

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractPatternsBasedResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractPatternsBasedResolver.java?rev=1222927&r1=1222926&r2=1222927&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractPatternsBasedResolver.java
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractPatternsBasedResolver.java
Sat Dec 24 07:22:52 2011
@@ -81,6 +81,15 @@ public abstract class AbstractPatternsBa
         return findResourceUsingPatterns(mrid, artifactPatterns, artifact,
             getDefaultRMDParser(artifact.getModuleRevisionId().getModuleId()), date);
     }
+    
+    public ResolvedResource findResource(ResolvedResource[] rress, ResourceMDParser rmdparser,
+            ModuleRevisionId mrid, Date date) {
+        if (isM2compatible()) {
+            // convert 'M2'-organisation back to 'Ivy'-organisation
+            mrid = convertM2ResourceSearchIdToNormal(mrid);
+        }
+        return super.findResource(rress, rmdparser, mrid, date);
+    }    
 
     protected ResolvedResource findResourceUsingPatterns(ModuleRevisionId moduleRevision,
             List patternList, Artifact artifact, ResourceMDParser rmdparser, Date date) {
@@ -328,6 +337,15 @@ public abstract class AbstractPatternsBa
     public void setM2compatible(boolean compatible) {
         m2compatible = compatible;
     }
+    
+    protected ModuleRevisionId convertM2ResourceSearchIdToNormal(ModuleRevisionId mrid) {
+        if (mrid.getOrganisation() == null || mrid.getOrganisation().indexOf('/') == -1)
{
+            return mrid;
+        }
+        return ModuleRevisionId.newInstance(mrid.getOrganisation().replace('/', '.'),
+            mrid.getName(), mrid.getBranch(), mrid.getRevision(),
+            mrid.getQualifiedExtraAttributes());
+    }
 
     protected ModuleRevisionId convertM2IdForResourceSearch(ModuleRevisionId mrid) {
         if (mrid.getOrganisation() == null || mrid.getOrganisation().indexOf('.') == -1)
{



Mime
View raw message