Author: xavier
Date: Tue Jun 10 10:07:39 2008
New Revision: 666208

URL: http://svn.apache.org/viewvc?rev=666208&view=rev
Log:
FIX: NPE in AbstractResolver.exists() if a resource cannot be found (IVY-831)

Modified:
    ant/ivy/core/trunk/CHANGES.txt
    
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResolver.java
    
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/MockResolver.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=666208&r1=666207&r2=666208&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Tue Jun 10 10:07:39 2008
@@ -83,6 +83,7 @@
 - IMPROVEMENT: Change allownomd and skipbuildwithoutivy into a more 
semantically correct name (IVY-297)
 - IMPROVEMENT: Smarter determination if an expression is exact or not for 
RegexpPatternMatcher and GlobPatternMatcher
 
+- FIX: NPE in AbstractResolver.exists() if a resource cannot be found (IVY-831)
 - FIX: Ivy distribution jars contains duplicate entries (IVY-828)
 - FIX: ivy:report will generate an HTML file that references non-existent 
ivy-report.css (IVY-826)
 - FIX: dynamic resolveMode not being dynamic on branch (IVY-825)

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResolver.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResolver.java?rev=666208&r1=666207&r2=666208&view=diff
==============================================================================
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResolver.java
 (original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResolver.java
 Tue Jun 10 10:07:39 2008
@@ -199,7 +199,7 @@
              * of DependencyResolver says that it should never return null
              */
             throw new IllegalStateException(
-                "null download report returned by " + getName() 
+                "null download report returned by " + getName() + " (" + 
getClass().getName() + ")" 
                 + " when trying to download " + artifact);
         }
         ArtifactDownloadReport adr = dr.getArtifactReport(artifact);

Modified: 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/MockResolver.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/MockResolver.java?rev=666208&r1=666207&r2=666208&view=diff
==============================================================================
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/MockResolver.java 
(original)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/MockResolver.java 
Tue Jun 10 10:07:39 2008
@@ -29,6 +29,7 @@
 import org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor;
 import org.apache.ivy.core.module.descriptor.DependencyDescriptor;
 import org.apache.ivy.core.module.id.ModuleRevisionId;
+import org.apache.ivy.core.report.ArtifactDownloadReport;
 import org.apache.ivy.core.report.DownloadReport;
 import org.apache.ivy.core.report.MetadataArtifactDownloadReport;
 import org.apache.ivy.core.resolve.DownloadOptions;
@@ -72,7 +73,11 @@
     }
 
     public DownloadReport download(Artifact[] artifacts, DownloadOptions 
options) {
-        return null;
+        DownloadReport dr = new DownloadReport();
+        for (int i = 0; i < artifacts.length; i++) {
+            dr.addArtifactReport(new ArtifactDownloadReport(artifacts[i]));
+        }
+        return dr;
     }
 
     public void publish(Artifact artifact, File src, boolean overwrite) throws 
IOException {


Reply via email to