You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by ma...@apache.org on 2008/03/18 23:53:36 UTC

svn commit: r638627 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/ant/IvyResolve.java test/java/org/apache/ivy/ant/IvyResolveTest.java

Author: maartenc
Date: Tue Mar 18 15:53:31 2008
New Revision: 638627

URL: http://svn.apache.org/viewvc?rev=638627&view=rev
Log:
FIX: NPE when specifying both resolveId and inline in an Ivy:Resolve (IVY-776)

Modified:
    ant/ivy/core/trunk/CHANGES.txt
    ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyResolve.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=638627&r1=638626&r2=638627&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Tue Mar 18 15:53:31 2008
@@ -73,6 +73,7 @@
 - IMPROVEMENT: Parse description and home page from poms (IVY-767)
 - IMPROVEMENT: Smarter determination if an expression is exact or not for RegexpPatternMatcher and GlobPatternMatcher
 
+- FIX: NPE when specifying both resolveId and inline in an Ivy:Resolve (IVY-776)
 - FIX: repreport task not working against a repository structured by branches (IVY-716)
 - FIX: Ivy reports a conflict when the same file is supposed to be retrieved at the same location twice (or more) (IVY-743)
 - FIX: StackOverflowError when configuration extends itself (IVY-696)

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=638627&r1=638626&r2=638627&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 Tue Mar 18 15:53:31 2008
@@ -299,10 +299,12 @@
                                 .setProperty("ivy.resolved.configurations." + resolveId, conf);
                         settings.setVariable("ivy.resolved.configurations." + resolveId, conf);
                     }
-                    getProject().setProperty("ivy.resolved.file." + resolveId,
-                        file.getAbsolutePath());
-                    settings
-                            .setVariable("ivy.resolved.file." + resolveId, file.getAbsolutePath());
+                    if (file != null) {
+                        getProject().setProperty("ivy.resolved.file." + resolveId,
+                            file.getAbsolutePath());
+                        settings
+                                .setVariable("ivy.resolved.file." + resolveId, file.getAbsolutePath());
+                    }
                 }
             }
         } catch (MalformedURLException e) {

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java?rev=638627&r1=638626&r2=638627&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java Tue Mar 18 15:53:31 2008
@@ -115,6 +115,22 @@
         assertTrue(getArchiveFileInCache("org1", "mod1.2", "2.0", "mod1.2", "jar", "jar").exists());
     }
 
+    public void testInlineWithResolveId() throws Exception {
+        // same as before, but expressing dependency directly without ivy file
+        resolve.setOrganisation("org1");
+        resolve.setModule("mod1.2");
+        resolve.setRevision("2.0");
+        resolve.setInline(true);
+        resolve.setResolveId("testInlineWithResolveId");
+        resolve.setKeep(true);
+        resolve.execute();
+
+        // dependencies
+        assertTrue(getIvyFileInCache(ModuleRevisionId.newInstance("org1", "mod1.2", "2.0"))
+                .exists());
+        assertTrue(getArchiveFileInCache("org1", "mod1.2", "2.0", "mod1.2", "jar", "jar").exists());
+    }
+
     public void testInlineForNonExistingModule() throws Exception {
         resolve.setOrganisation("org1XX");
         resolve.setModule("mod1.2");