ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xav...@apache.org
Subject svn commit: r612175 - in /ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver: AbstractResourceResolver.java util/ResourceMDParser.java
Date Tue, 15 Jan 2008 17:54:26 GMT
Author: xavier
Date: Tue Jan 15 09:54:25 2008
New Revision: 612175

URL: http://svn.apache.org/viewvc?rev=612175&view=rev
Log:
FIX: NPE while resolving dependencies (IVY-701)

Modified:
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResourceResolver.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/util/ResourceMDParser.java

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResourceResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResourceResolver.java?rev=612175&r1=612174&r2=612175&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResourceResolver.java
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResourceResolver.java
Tue Jan 15 09:54:25 2008
@@ -158,6 +158,12 @@
             }
             if (versionMatcher.needModuleDescriptor(mrid, foundMrid)) {
                 ResolvedResource r = rmdparser.parse(rres.getResource(), rres.getRevision());
+                if (r == null) {
+                    Message.debug("\t" + name 
+                        + ": impossible to get module descriptor resource: " + rres);
+                    rejected.add(rres.getRevision() + " (no or bad MD)");
+                    continue;
+                }
                 ModuleDescriptor md = ((MDResolvedResource) r).getResolvedModuleRevision()
                         .getDescriptor();
                 if (md.isDefault()) {

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/util/ResourceMDParser.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/util/ResourceMDParser.java?rev=612175&r1=612174&r2=612175&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/util/ResourceMDParser.java
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/util/ResourceMDParser.java
Tue Jan 15 09:54:25 2008
@@ -20,5 +20,15 @@
 import org.apache.ivy.plugins.repository.Resource;
 
 public interface ResourceMDParser {
+    /**
+     * Parses the module descriptor designed by the given resource.
+     * 
+     * @param resource
+     *            the resource at which the module descriptor is located
+     * @param rev
+     *            the revision at which the module descriptor should be
+     * @return the parsed module descriptor as a {@link MDResolvedResource}, or <code>null</code>
+     *         if parsing has failed or if the resource is not available.
+     */
     MDResolvedResource parse(Resource resource, String rev);
 }



Mime
View raw message