ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xav...@apache.org
Subject svn commit: r619957 - /ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/DefaultRepositoryCacheManager.java
Date Fri, 08 Feb 2008 17:52:15 GMT
Author: xavier
Date: Fri Feb  8 09:52:09 2008
New Revision: 619957

URL: http://svn.apache.org/viewvc?rev=619957&view=rev
Log:
check for module descriptor nullity, to avoid a NPE if the ModuleDescriptorParser does not
fulfill its contract

Modified:
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/DefaultRepositoryCacheManager.java

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/DefaultRepositoryCacheManager.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/DefaultRepositoryCacheManager.java?rev=619957&r1=619956&r2=619957&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/DefaultRepositoryCacheManager.java
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/DefaultRepositoryCacheManager.java
Fri Feb  8 09:52:09 2008
@@ -890,6 +890,14 @@
             try {
                 ModuleDescriptor md = parser.parseDescriptor(
                     settings, cachedMDURL, mdRef.getResource(), options.isValidate());
+                if (md == null) {
+                    throw new IllegalStateException(
+                        "module descriptor parser returned a null module descriptor, " 
+                        + "which is not allowed. "
+                        + "parser=" + parser 
+                        + "; parser class=" + parser.getClass().getName()
+                        + "; module descriptor resource=" + mdRef.getResource());
+                }
                 Message.debug("\t" + getName() + ": parsed downloaded md file for " + mrid

                     + "; parsed=" + md.getModuleRevisionId());
 



Mime
View raw message