You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2010/06/29 01:24:29 UTC

DO NOT REPLY [Bug 49514] New: property task incorrectly sets properties when prefix is used

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.

DO NOT REPLY [Bug 49514] property task incorrectly sets properties when prefix is used

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49514

Jesse Glick <jg...@netbeans.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |jglick@netbeans.org
         Resolution|                            |FIXED
   Target Milestone|---                         |1.8.1

--- Comment #2 from Jesse Glick <jg...@netbeans.org> 2010-06-29 12:39:01 EDT ---
Works in 1.7.1, 1.8.1, and 1.8.2 after the fix of bug #49373; only fails in
1.8.0.

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

DO NOT REPLY [Bug 49514] property task incorrectly sets properties when prefix is used

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49514

--- Comment #1 from Andrew Black <an...@roguewave.com> 2010-06-28 19:27:13 EDT ---
This appears to be related to bug 40561, but the behavior was working as
expected in a versions newer than 1.6.5.

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