From 03481a6b0cc6a512faea9a1c58021eb1c3c29031 Mon Sep 17 00:00:00 2001
From: Stefan Bodewig <bodewig@apache.org>
Date: Sun, 17 Apr 2016 06:43:45 +0200
Subject: [PATCH] lower-case macro attribute names set via API

For normal build files IntrospectionHelper has already handled the
lower-casing.

Bugzilla Report 59339
---
 WHATSNEW                                                  | 5 +++++
 src/main/org/apache/tools/ant/taskdefs/MacroInstance.java | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/WHATSNEW b/WHATSNEW
index 42eab4769..681b5cf4b 100644
--- a/WHATSNEW
+++ b/WHATSNEW
@@ -7,6 +7,11 @@ Changes that could break older environments:
 Fixed bugs:
 -----------
 
+ * setDynamicAttribute on MacroInstance now lower-cases the attribute
+   name in order to allow users of the API to use the attributes names
+   they have specified.
+   Bugzilla Report 59339
+
 Other changes:
 --------------
 
diff --git a/src/main/org/apache/tools/ant/taskdefs/MacroInstance.java b/src/main/org/apache/tools/ant/taskdefs/MacroInstance.java
index 32b1a1a25..682ca1245 100644
--- a/src/main/org/apache/tools/ant/taskdefs/MacroInstance.java
+++ b/src/main/org/apache/tools/ant/taskdefs/MacroInstance.java
@@ -81,7 +81,7 @@ public class MacroInstance extends Task implements DynamicAttribute, TaskContain
      * @param value the value of the attribute
      */
     public void setDynamicAttribute(String name, String value) {
-        map.put(name, value);
+        map.put(name.toLowerCase(Locale.ENGLISH), value);
     }
 
     /**