ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r917574 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/taskdefs/Get.java
Date Mon, 01 Mar 2010 16:33:47 GMT
Author: stevel
Date: Mon Mar  1 16:33:47 2010
New Revision: 917574

URL: http://svn.apache.org/viewvc?rev=917574&view=rev
Log:
Bug 48833 -  NPE in <get>

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Get.java

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=917574&r1=917573&r2=917574&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Mon Mar  1 16:33:47 2010
@@ -44,6 +44,9 @@
 *  If <concat>'s first resourcecollection child is a <resources>,
    any subsequently added child resourcecollection joins the first.
    Bugzilla Report 48816.        
+   
+*  <get> with an invalid URL could trigger an NPE in some JVMs.
+   Bugzilla Report 48833 
 
 Other changes:
 --------------

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Get.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Get.java?rev=917574&r1=917573&r2=917574&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Get.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Get.java Mon Mar  1 16:33:47 2010
@@ -658,7 +658,12 @@
                         .setUseCaches(httpUseCaches);
             }
             // connect to the remote site (may take some time)
-            connection.connect();
+            try {
+                connection.connect();
+            } catch (NullPointerException e) {
+                //bad URLs can trigger NPEs in some JVMs
+                throw new BuildException("Failed to parse " + source.toString(), e);
+            }
 
             // First check on a 301 / 302 (moved) response (HTTP only)
             if (connection instanceof HttpURLConnection) {



Mime
View raw message