You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2002/07/01 22:57:15 UTC
DO NOT REPLY [Bug 10386] New: -
condition with isset does not return valid results on ${env.} when varname is not defined
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10386>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10386
condition with isset does not return valid results on ${env.<varname>} when varname is not defined
Summary: condition with isset does not return valid results on
${env.<varname>} when varname is not defined
Product: Ant
Version: 1.5Beta3
Platform: All
OS/Version: All
Status: NEW
Severity: Critical
Priority: Other
Component: Core tasks
AssignedTo: ant-dev@jakarta.apache.org
ReportedBy: vpatryshev@borland.com
Try this:
<property name="var7" value="var7 not assigned"/>
<condition property="var7" value="var7 assigned">
<isset property="${env.var0}"/>
</condition>
<property name="var8" value="var8 not assigned"/>
<condition property="var8" value="var8 assigned">
<not>
<isset property="${env.var0}"/>
</not>
</condition>
<echo message="${var7} ${var8}"/>
Both will print "not assigned" - meaning that there must be an exception thrown
or something.
This does not work correctly with 1.4.1 or the latest 1.6 either.
I also tried this:
<property name="para0" value="$"/>
<property name="para1" value="\$"/>
<property name="var0" value="${env.var0}"/>
<property name="var1" value="var1 not assigned"/>
<condition property="var1" value="var1 assigned">
<not>
<equals arg1="${env.var0}" arg2="${para0}{env.var0}"/>
</not>
</condition>
<property name="var2" value="var2 not assigned"/>
<condition property="var2" value="var2 assigned">
<not>
<equals arg1="${env.var0}" arg2="${para1}{env.var0}"/>
</not>
</condition>
<property name="var3" value="var3 not assigned"/>
<condition property="var3" value="var3 assigned">
<equals arg1="${env.var0}" arg2="${para0}{env.var0}"/>
</condition>
<property name="var4" value="var4 not assigned"/>
<condition property="var4" value="var4 assigned">
<equals arg1="${env.var0}" arg2="${para1}{env.var0}"/>
</condition>
<property name="var5" value="var5 not assigned"/>
<condition property="var5" value="var5 assigned">
<equals arg1="${env.var0}" arg2="$${env.var0}"/>
</condition>
<property name="var6" value="var6 not assigned"/>
<condition property="var6" value="var6 assigned">
<not>
<equals arg1="${env.var0}" arg2="$${env.var0}"/>
</not>
</condition>
In all these cases var1..var6 remain not assigned.
It is not logical, to have condition X and <not> condition X return false.
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>