Author: bodewig
Date: Thu Nov 17 11:56:43 2011
New Revision: 1203160
URL: http://svn.apache.org/viewvc?rev=1203160&view=rev
Log:
no reason to log at ERR if a URL doesn't exist and all we do is checking
whether it does. Addresses PR 51802
Modified:
ant/core/trunk/WHATSNEW
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/URLResource.java
Modified: ant/core/trunk/WHATSNEW
URL:
http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=1203160&r1=1203159&r2=1203160&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Thu Nov 17 11:56:43 2011
@@ -144,6 +144,9 @@ Other changes:
used for up-to-date-ness checks.
Bugzilla Report 52096.
+ * URLResources#isExists has become less noisy.
+ Bugzilla Report 51802.
+
Changes from Ant 1.8.1 TO Ant 1.8.2
===================================
Modified:
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/URLResource.java
URL:
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/resources/URLResource.java?rev=1203160&r1=1203159&r2=1203160&view=diff
==============================================================================
---
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/URLResource.java
(original)
+++
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/URLResource.java
Thu Nov 17 11:56:43 2011
@@ -226,7 +226,7 @@ public class URLResource extends Resourc
return false;
}
try {
- connect();
+ connect(Project.MSG_VERBOSE);
return true;
} catch (IOException e) {
return false;
@@ -363,7 +363,19 @@ public class URLResource extends Resourc
* Ensure that we have a connection.
* @throws IOException if the connection cannot be established.
*/
- protected synchronized void connect() throws IOException {
+ protected void connect() throws IOException {
+ connect(Project.MSG_ERR);
+ }
+
+ /**
+ * Ensure that we have a connection.
+ * @param logLevel severity to use when logging connection errors.
+ * Should be one of the <code>MSG_</code> constants in {@link
+ * Project Project}.
+ * @throws IOException if the connection cannot be established.
+ * @since Ant 1.8.2
+ */
+ protected synchronized void connect(int logLevel) throws IOException {
URL u = getURL();
if (u == null) {
throw new BuildException("URL not set");
@@ -373,7 +385,7 @@ public class URLResource extends Resourc
conn = u.openConnection();
conn.connect();
} catch (IOException e) {
- log(e.toString(), Project.MSG_ERR);
+ log(e.toString(), logLevel);
conn = null;
throw e;
}