You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by hi...@apache.org on 2008/05/16 00:45:51 UTC

svn commit: r656885 - in /ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer: IvyClasspathContainer.java IvyResolveJob.java

Author: hibou
Date: Thu May 15 15:45:50 2008
New Revision: 656885

URL: http://svn.apache.org/viewvc?rev=656885&view=rev
Log:
IVYDE-91: NPE when setting a bad file for the ivy setting path in the global configuration panel
 - handle no ivy while starting a resolve job

Modified:
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainer.java
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyResolveJob.java

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainer.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainer.java?rev=656885&r1=656884&r2=656885&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainer.java (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainer.java Thu May 15 15:45:50 2008
@@ -182,7 +182,11 @@
                     // resolve job already running
                     return job;
                 }
-                job = new IvyResolveJob(this, usePreviousResolveIfExist, notify, conf);
+                Ivy ivy = IvyPlugin.getIvy(conf.getInheritedIvySettingsPath());
+                if (ivy == null) {
+                    return null;
+                }
+                job = new IvyResolveJob(this, usePreviousResolveIfExist, notify, conf, ivy);
                 job.setUser(isUser);
                 job.setRule(RESOLVE_EVENT_RULE);
                 return job;

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyResolveJob.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyResolveJob.java?rev=656885&r1=656884&r2=656885&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyResolveJob.java (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyResolveJob.java Thu May 15 15:45:50 2008
@@ -88,24 +88,24 @@
 
     private boolean _notify;
 
-    private Ivy ivy;
+    private final Ivy ivy;
 
     private final IvyClasspathContainerConfiguration conf;
 
     private final IvyClasspathContainer container;
 
     public IvyResolveJob(IvyClasspathContainer container, boolean usePreviousResolveIfExist,
-            boolean notify, IvyClasspathContainerConfiguration conf) throws FileNotFoundException,
+            boolean notify, IvyClasspathContainerConfiguration conf, Ivy ivy) throws FileNotFoundException,
             ParseException, IOException {
         super("Resolve "
                 + (conf.getJavaProject() == null ? "" : conf.getJavaProject().getProject()
                         .getName()
                         + "/") + conf.ivyXmlPath + " dependencies");
         this.container = container;
+        this.ivy = ivy;
         _usePreviousResolveIfExist = usePreviousResolveIfExist;
         _notify = notify;
         this.conf = conf;
-        ivy = IvyPlugin.getIvy(conf.getInheritedIvySettingsPath());
     }
 
     public void transferProgress(TransferEvent evt) {