ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xav...@apache.org
Subject svn commit: r640519 - /ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java
Date Mon, 24 Mar 2008 18:58:56 GMT
Author: xavier
Date: Mon Mar 24 11:58:53 2008
New Revision: 640519

URL: http://svn.apache.org/viewvc?rev=640519&view=rev
Log:
Attempt to fix IVY-773 (Extra Attributes are not available to resolver after resolve if cache
was empty)

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

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java?rev=640519&r1=640518&r2=640519&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java Mon Mar
24 11:58:53 2008
@@ -397,25 +397,29 @@
     }
 
     private void resolveAndCheckRevision(ModuleDescriptor systemMd,
-            ModuleRevisionId systemMrid, ResolvedResource ivyRef, boolean isDynamic) {
-        ModuleRevisionId resolvedMrid = systemMrid;
-        if (isDynamic) {
-            resolvedMrid = systemMd.getResolvedModuleRevisionId();
-            if (resolvedMrid.getRevision() == null 
-                    || resolvedMrid.getRevision().length() == 0) {
-                if (ivyRef.getRevision() == null || ivyRef.getRevision().length() == 0) {
-                    resolvedMrid = ModuleRevisionId.newInstance(resolvedMrid, "working@"
-                        + getName());
-                } else {
-                    resolvedMrid = ModuleRevisionId.newInstance(resolvedMrid, ivyRef
-                        .getRevision());
-                }
+            ModuleRevisionId dependencyConstraint, ResolvedResource ivyRef, boolean isDynamic)
{
+        // we get the resolved module revision id from the descriptor: it may contain extra
+        // attributes that were not included in the dependency constraint
+        ModuleRevisionId resolvedMrid = systemMd.getResolvedModuleRevisionId();
+        if (resolvedMrid.getRevision() == null 
+                || resolvedMrid.getRevision().length() == 0) {
+            if (!isDynamic) {
+                resolvedMrid = ModuleRevisionId.newInstance(
+                    resolvedMrid, dependencyConstraint.getRevision());
+            } else if (ivyRef.getRevision() == null || ivyRef.getRevision().length() == 0)
{
+                resolvedMrid = ModuleRevisionId.newInstance(resolvedMrid, "working@"
+                    + getName());
+            } else {
+                resolvedMrid = ModuleRevisionId.newInstance(resolvedMrid, ivyRef
+                    .getRevision());
             }
+        }
+        if (isDynamic) {
             Message.verbose("\t\t[" + toSystem(resolvedMrid).getRevision() + "] " 
-                + systemMrid.getModuleId());
+                + dependencyConstraint.getModuleId());
         }
         systemMd.setResolvedModuleRevisionId(resolvedMrid); 
-        checkModuleDescriptorRevision(systemMd, systemMrid);
+        checkModuleDescriptorRevision(systemMd, dependencyConstraint);
     }
 
     private String getRevision(ResolvedResource ivyRef, ModuleRevisionId askedMrid,



Mime
View raw message