ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 45372] New: Property substitution behaves odd in complex cases
Date Thu, 10 Jul 2008 11:41:42 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=45372

           Summary: Property substitution behaves odd in complex cases
           Product: Ant
           Version: 1.7.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Core
        AssignedTo: notifications@ant.apache.org
        ReportedBy: mikhail.vladimirov@db.com


Created an attachment (id=22242)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22242)
Property substitution routines

build.xml:

<project default="print">
  <property file="build.properties" />
  <target name="print">
    <echo message="a: ${a}" />
    <echo message="b: ${b}" />
    <echo message="c: ${c}" />
    <echo message="d: ${d}" />
    <echo message="e: ${e}" />
    <echo message="f: ${f}" />
  </target>
</project>

build.properies:

a: $
b: {
c: }
d: x
e: ${a}${b}d${c}
# f: ${e}

result:

     [echo] a: $
     [echo] b: {
     [echo] c: }
     [echo] d: x
     [echo] e: ${d}
     [echo] f: ${f}

This is fine.

If we uncomment last line in build.properties, the result is quite surprising:

     [echo] a: $
     [echo] b: {
     [echo] c: }
     [echo] d: x
     [echo] e: x
     [echo] f: ${d}

The value of 'e' property changed, while we've just defined one more property. 
For me this is odd behavior.

My property-substitution code is attached.  Maybe it can help to make ant's
substitution algorithm more predictable.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Mime
View raw message