Author: maartenc
Date: Thu May 22 21:12:24 2014
New Revision: 1596968

URL: http://svn.apache.org/r1596968
Log:
FIX: failed to resolve dynamic revisions in some cases for URL repositories 
(IVY-1472)

Modified:
    ant/ivy/core/trunk/CHANGES.txt
    
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/util/ResolverHelper.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=1596968&r1=1596967&r2=1596968&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Thu May 22 21:12:24 2014
@@ -149,6 +149,7 @@ for detailed view of each issue, please 
 - FIX: impossible to get artifacts when data has not been loaded. (IVY-1399) 
(Thanks to David Turner)
 - FIX: regression introduced by IVY-1457, dependency management wasn't 
properly handled introducing lots of resolution failures
 - FIX: The SSH resolvers fails if the un-required jsch jar is missing 
(IVY-1471)
+- FIX: failed to resolve dynamic revisions in some cases for URL repositories 
(IVY-1472)
 
    2.4.0-rc1
 =====================================

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/util/ResolverHelper.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/util/ResolverHelper.java?rev=1596968&r1=1596967&r2=1596968&view=diff
==============================================================================
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/util/ResolverHelper.java
 (original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/util/ResolverHelper.java
 Thu May 22 21:12:24 2014
@@ -61,10 +61,10 @@ public final class ResolverHelper {
 
             try {
                 Message.debug("\tusing " + rep + " to list all in " + root);
-                List all = rep.list(root);
+                String[] all = listAll(rep, root);
                 if (all != null) {
-                    Message.debug("\t\tfound " + all.size() + " urls");
-                    List ret = new ArrayList(all.size());
+                    Message.debug("\t\tfound " + all.length + " urls");
+                    List<String> ret = new ArrayList<String>(all.length);
                     int endNameIndex = pattern.indexOf(fileSep, slashIndex + 
1);
                     String namePattern;
                     if (endNameIndex != -1) {
@@ -75,9 +75,8 @@ public final class ResolverHelper {
                     namePattern = namePattern.replaceAll("\\.", "\\\\.");
                     namePattern = 
IvyPatternHelper.substituteToken(namePattern, token, "(.+)");
                     Pattern p = Pattern.compile(namePattern);
-                    for (Iterator iter = all.iterator(); iter.hasNext();) {
-                        String path = (String) iter.next();
-                        Matcher m = p.matcher(path.substring(root.length() + 
1));
+                    for (String path : all) {
+                        Matcher m = p.matcher(path);
                         if (m.matches()) {
                             String value = m.group(1);
                             ret.add(value);
@@ -88,9 +87,6 @@ public final class ResolverHelper {
                 } else {
                     return null;
                 }
-            } catch (IOException e) {
-                Message.verbose("problem while listing resources in " + root + 
" with " + rep, e);
-                return null;
             } catch (Exception e) {
                 Message.warn("problem while listing resources in " + root + " 
with " + rep, e);
                 return null;


Reply via email to