From 04330159c29d6fe51ca0404cde7d5aa86897fd6d Mon Sep 17 00:00:00 2001 From: Peter Reilly Date: Tue, 15 Mar 2005 13:35:28 +0000 Subject: [PATCH] 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. PR: 31215 git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277968 13f79535-47bb-0310-9956-ffa450edef68 --- WHATSNEW | 5 +++++ src/main/org/apache/tools/ant/taskdefs/MacroDef.java | 6 ++++++ 2 files changed, 11 insertions(+) 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;