ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject git commit: revert e8b160a which didn't fix anything but rather broke stuff
Date Fri, 22 Aug 2014 04:29:47 GMT
Repository: ant
Updated Branches:
  refs/heads/master e8b160a93 -> ad72b9a92


revert e8b160a which didn't fix anything but rather broke stuff


Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/ad72b9a9
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/ad72b9a9
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/ad72b9a9

Branch: refs/heads/master
Commit: ad72b9a92036b02e00cf28740c27322a93256328
Parents: e8b160a
Author: Stefan Bodewig <bodewig@apache.org>
Authored: Fri Aug 22 06:29:29 2014 +0200
Committer: Stefan Bodewig <bodewig@apache.org>
Committed: Fri Aug 22 06:29:29 2014 +0200

----------------------------------------------------------------------
 WHATSNEW                                                  |  5 -----
 .../org/apache/tools/ant/types/resources/URLResource.java | 10 ++--------
 2 files changed, 2 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant/blob/ad72b9a9/WHATSNEW
----------------------------------------------------------------------
diff --git a/WHATSNEW b/WHATSNEW
index 36b9880..5894c07 100644
--- a/WHATSNEW
+++ b/WHATSNEW
@@ -27,11 +27,6 @@ Fixed bugs:
    cannot determine the local hostname.
    Bugzilla Report 56593
 
- * URLResource#getLastModified tried to access the connection to the
-   URL without making sure it was established, potentially leading to
-   a NullPointerException.
-   Bugzilla Report 56873
-
 Other changes:
 --------------
 

http://git-wip-us.apache.org/repos/asf/ant/blob/ad72b9a9/src/main/org/apache/tools/ant/types/resources/URLResource.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/types/resources/URLResource.java b/src/main/org/apache/tools/ant/types/resources/URLResource.java
index ab564ca..a143908 100644
--- a/src/main/org/apache/tools/ant/types/resources/URLResource.java
+++ b/src/main/org/apache/tools/ant/types/resources/URLResource.java
@@ -263,16 +263,10 @@ public class URLResource extends Resource implements URLProvider {
             return ((Resource) getCheckedRef()).getLastModified();
         }
         if (!isExists(false)) {
-            return 0L;
-        }
-        try {
-            connect();
-            long lastModified = conn.getLastModified();
-            close();
-            return lastModified;
-        } catch (IOException e) {
             return UNKNOWN_DATETIME;
         }
+        // isExists has already opened the connection
+        return conn.getLastModified();
     }
 
     /**


Mime
View raw message