https://issues.apache.org/bugzilla/show_bug.cgi?id=49373

           Summary: Property expansion inaccurate for prefixed file-based
                    property loads.
           Product: Ant
           Version: 1.8.1
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
        AssignedTo: notifications@ant.apache.org
        ReportedBy: apache...@g3i.de


Unexpected behaviour change between Ant 1.8.0 (OK) and Ant 1.8.1 (wrong).

 <property file="foo.properties" prefix="prfx" />

Loading properties from a file should apply the prefix only to the newly loaded
properties. The prefix should not be used for property expansions on the value
side.

Below build.xml works with Ant 1.8.0 and fails with Ant 1.8.1:

---8<---
<?xml version="1.0" encoding="UTF-8"?>
<project name="Test1" default="test1">

    <target name="test1">
        <echo file="foo.properties" message="abc=$${def}" />
        <property name="def" value="ghi" />
        <property name="prfx.def" value="jkl" />
        <property file="foo.properties" prefix="prfx" />
        <echo message="Value of $${prfx.abc} is ${prfx.abc}, should be ghi,
should not be jkl." />
    </target>

</project>
---8<---

1.8.0:
[echo] Value of ${prfx.abc} is ghi, should be ghi, should not be jkl.

1.8.1 (wrong):
[echo] Value of ${prfx.abc} is jkl, should be ghi, should not be jkl.

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

Reply via email to