ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hi...@apache.org
Subject svn commit: r1373369 - /ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyResolve.java
Date Wed, 15 Aug 2012 12:33:07 GMT
Author: hibou
Date: Wed Aug 15 12:33:07 2012
New Revision: 1373369

URL: http://svn.apache.org/viewvc?rev=1373369&view=rev
Log:
IVY-1288 : fix NPE when there is no branch

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

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyResolve.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyResolve.java?rev=1373369&r1=1373368&r2=1373369&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyResolve.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyResolve.java Wed Aug 15 12:33:07 2012
@@ -357,17 +357,21 @@ public class IvyResolve extends IvyTask 
                     String parentModule = parent.getResolvedParentRevisionId().getName();
                     String parentRevision = parent.getResolvedParentRevisionId().getRevision();
                     String parentBranch = parent.getResolvedParentRevisionId().getBranch();
-                    getProject().setProperty("ivy.parent["+i+"].organisation", parentOrg);
-                    settings.setVariable("ivy.parent["+i+"].organisation", parentOrg);
-                    getProject().setProperty("ivy.parent["+i+"].module", parentModule);
-                    settings.setVariable("ivy.parent["+i+"].module", parentModule);
-                    getProject().setProperty("ivy.parent["+i+"].revision", parentRevision);
-                    settings.setVariable("ivy.parent["+i+"].revision", parentRevision);
-                    getProject().setProperty("ivy.parent["+i+"].branch", parentBranch);
-                    settings.setVariable("ivy.parent["+i+"].branch", parentBranch);
+                    getProject().setProperty("ivy.parent[" + i + "].organisation", parentOrg);
+                    settings.setVariable("ivy.parent[" + i + "].organisation", parentOrg);
+                    getProject().setProperty("ivy.parent[" + i + "].module", parentModule);
+                    settings.setVariable("ivy.parent[" + i + "].module", parentModule);
+                    getProject().setProperty("ivy.parent[" + i + "].revision", parentRevision);
+                    settings.setVariable("ivy.parent[" + i + "].revision", parentRevision);
+                    if (parentBranch != null) {
+                        getProject().setProperty("ivy.parent[" + i + "].branch", parentBranch);
+                        settings.setVariable("ivy.parent[" + i + "].branch", parentBranch);
+                    }
                 }
-                getProject().setProperty("ivy.parents.count", String.valueOf(md.getInheritedDescriptors().length));
-                settings.setVariable("ivy.parents.count", String.valueOf(md.getInheritedDescriptors().length));
+                getProject().setProperty("ivy.parents.count",
+                    String.valueOf(md.getInheritedDescriptors().length));
+                settings.setVariable("ivy.parents.count",
+                    String.valueOf(md.getInheritedDescriptors().length));
 
                 Boolean hasChanged = null;
                 if (getCheckIfChanged()) {



Mime
View raw message