From 8e933d962a21ce50966040e5b1d1fda933ceab08 Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Tue, 12 Oct 2004 20:52:34 +0000 Subject: [PATCH] ispingable is defined, corrected validation logic (I think :) git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276940 13f79535-47bb-0310-9956-ffa450edef68 --- .../tools/ant/taskdefs/optional/condition/IsPingable.java | 2 +- src/main/org/apache/tools/ant/types/defaults.properties | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/condition/IsPingable.java b/src/main/org/apache/tools/ant/taskdefs/optional/condition/IsPingable.java index 8084522fa..5e489a790 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/condition/IsPingable.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/condition/IsPingable.java @@ -71,7 +71,7 @@ public class IsPingable extends ProjectComponent implements Condition { * if an error occurs */ public boolean eval() throws BuildException { - if(host==null && host.length()==0) { + if(host==null || host.length()==0) { throw new BuildException(ERROR_NO_HOSTNAME); } if(timeout<0) { diff --git a/src/main/org/apache/tools/ant/types/defaults.properties b/src/main/org/apache/tools/ant/types/defaults.properties index 55f1e96e5..126314acb 100644 --- a/src/main/org/apache/tools/ant/types/defaults.properties +++ b/src/main/org/apache/tools/ant/types/defaults.properties @@ -33,3 +33,4 @@ scriptfilter=org.apache.tools.ant.types.optional.ScriptFilter propertyset=org.apache.tools.ant.types.PropertySet assertions=org.apache.tools.ant.types.Assertions concatfilter=org.apache.tools.ant.filters.ConcatFilter +org.apache.tools.ant.taskdefs.optional.condition.IsPingable \ No newline at end of file