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 49514] New: property task incorrectly sets properties when prefix is used
Date Mon, 28 Jun 2010 23:24:29 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=49514

           Summary: property task incorrectly sets properties when prefix
                    is used
           Product: Ant
           Version: 1.8.0
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: regression
          Priority: P2
         Component: Core tasks
        AssignedTo: notifications@ant.apache.org
        ReportedBy: andrew.black@roguewave.com


If using an <property file="" prefix=""> task, and a property was previously
defined that is also defined in the property file, the value created using the
prefix will be a copy of the previously defined property, rather than the value
from the file. A test case is as follows:

<?xml version="1.0"?>

<project name="bug-test" default="test" basedir=".">
  <target name="test">
    <property name="foo" value="bar"/>
    <echo file="test.properties" message="foo=baz"/>
    <property file="test.properties" prefix="old."/>
    <fail message="Incorrect value for old.foo: got '${old.foo}', expected
'baz'">
      <condition><not><equals arg1="${old.foo}" arg2="baz"/></not></condition>
    </fail>
  </target>
</project>

This test case succeeds with Ant 1.7.1, but fails with 1.8.0.

While a partial workaround exists (don't define properties in your file that
you'll import), this can pose problems when you attempt to load two different
versions of a property file for comparison.  This comparison is useful if
you're attempting to short-circuit an expensive action, based on metadata
stored in the property file.

-- 
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