diff --git a/WHATSNEW b/WHATSNEW index 7d95d12c9..6ffe7e646 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -275,6 +275,11 @@ Other changes: * The .NET compilation tasks failed if filenames given as references contained spaces. Bugzilla Report 27170. +* with default values set by properties would be + seen as new definitions when called twice with different properties. + This was confusing so the definitions are now treated as similar. + Bugzilla Report 31215. + Fixed bugs: ----------- diff --git a/src/main/org/apache/tools/ant/taskdefs/MacroDef.java b/src/main/org/apache/tools/ant/taskdefs/MacroDef.java index 79de27123..cc7f65081 100644 --- a/src/main/org/apache/tools/ant/taskdefs/MacroDef.java +++ b/src/main/org/apache/tools/ant/taskdefs/MacroDef.java @@ -716,6 +716,12 @@ public class MacroDef extends AntlibDefinition { if (!name.equals(other.name)) { return false; } + // Allow two macro definitions with the same location + // to be treated as similar - bugzilla 31215 + if (other.getLocation() != null + && other.getLocation().equals(getLocation())) { + return true; + } if (text == null) { if (other.text != null) { return false;