diff --git a/WHATSNEW b/WHATSNEW index 3dc0e0908..7c65633a7 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -4,6 +4,13 @@ Changes from Ant 1.9.3 TO current Changes that could break older environments: ------------------------------------------- + * the prefixValues attribute of didn't work as expected + when set to false (the default). + It is quite likely existing build files relied on the wrong + behavior and expect Ant to resolve the value side against the + properties defined in the property file itself - these build files + must now explicitly set the prefixValues attribute to true. + Bugzilla Report 54769 Fixed bugs: ----------- diff --git a/src/main/org/apache/tools/ant/property/ResolvePropertyMap.java b/src/main/org/apache/tools/ant/property/ResolvePropertyMap.java index 3da3e5d67..ca53e99d4 100644 --- a/src/main/org/apache/tools/ant/property/ResolvePropertyMap.java +++ b/src/main/org/apache/tools/ant/property/ResolvePropertyMap.java @@ -87,10 +87,19 @@ public class ResolvePropertyMap implements GetProperty { } seen.add(name); + + String recursiveCallKey = name; + if (prefix != null && !expandingLHS && !prefixValues) { + // only look up unprefixed properties inside the map + // if prefixValues is true or we are expanding the key + // itself + recursiveCallKey = prefix + name; + } + expandingLHS = false; // will recurse into this method for each property // reference found in the map's value - return parseProperties.parseProperties((String) map.get(name)); + return parseProperties.parseProperties((String) map.get(recursiveCallKey)); } finally { seen.remove(name); } diff --git a/src/tests/antunit/taskdefs/property-test.xml b/src/tests/antunit/taskdefs/property-test.xml index 382f39f48..6cb132599 100644 --- a/src/tests/antunit/taskdefs/property-test.xml +++ b/src/tests/antunit/taskdefs/property-test.xml @@ -135,4 +135,19 @@ y=$${x} + + + + + + + + + + +