From 0036584e2cd10964a34f1f364853f9b100d1508c Mon Sep 17 00:00:00 2001 From: Peter Reilly Date: Mon, 13 Sep 2004 09:11:47 +0000 Subject: [PATCH] make IntrospectionHelper compile under jdk1.2.2 git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276854 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tools/ant/IntrospectionHelper.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/org/apache/tools/ant/IntrospectionHelper.java b/src/main/org/apache/tools/ant/IntrospectionHelper.java index 9cf36058b..723d8c1a1 100644 --- a/src/main/org/apache/tools/ant/IntrospectionHelper.java +++ b/src/main/org/apache/tools/ant/IntrospectionHelper.java @@ -25,6 +25,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Enumeration; import java.util.Hashtable; +import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; @@ -39,6 +40,13 @@ import org.apache.tools.ant.taskdefs.PreSetDef; */ public final class IntrospectionHelper implements BuildListener { + /** + * EMPTY_MAP was added in java 1.3 (EMTPY_SET and EMPTY_LIST + * is in java 1.2!) + */ + private static final Map EMPTY_MAP = Collections.unmodifiableMap( + new HashMap()); + /** * Map from attribute names to attribute types * (String to Class). @@ -942,7 +950,7 @@ public final class IntrospectionHelper implements BuildListener { */ public Map getAttributeMap() { if (attributeTypes.size() < 1) { - return Collections.EMPTY_MAP; + return EMPTY_MAP; } return Collections.unmodifiableMap(attributeTypes); } @@ -969,7 +977,7 @@ public final class IntrospectionHelper implements BuildListener { */ public Map getNestedElementMap() { if (nestedTypes.size() < 1) { - return Collections.EMPTY_MAP; + return EMPTY_MAP; } return Collections.unmodifiableMap(nestedTypes); }