Browse Source

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
master
Peter Reilly 21 years ago
parent
commit
0036584e2c
1 changed files with 10 additions and 2 deletions
  1. +10
    -2
      src/main/org/apache/tools/ant/IntrospectionHelper.java

+ 10
- 2
src/main/org/apache/tools/ant/IntrospectionHelper.java View File

@@ -25,6 +25,7 @@ import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.Hashtable; import java.util.Hashtable;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Map; import java.util.Map;
@@ -39,6 +40,13 @@ import org.apache.tools.ant.taskdefs.PreSetDef;
*/ */
public final class IntrospectionHelper implements BuildListener { 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 * Map from attribute names to attribute types
* (String to Class). * (String to Class).
@@ -942,7 +950,7 @@ public final class IntrospectionHelper implements BuildListener {
*/ */
public Map getAttributeMap() { public Map getAttributeMap() {
if (attributeTypes.size() < 1) { if (attributeTypes.size() < 1) {
return Collections.EMPTY_MAP; return EMPTY_MAP;
} }
return Collections.unmodifiableMap(attributeTypes); return Collections.unmodifiableMap(attributeTypes);
} }
@@ -969,7 +977,7 @@ public final class IntrospectionHelper implements BuildListener {
*/ */
public Map getNestedElementMap() { public Map getNestedElementMap() {
if (nestedTypes.size() < 1) { if (nestedTypes.size() < 1) {
return Collections.EMPTY_MAP; return EMPTY_MAP;
} }
return Collections.unmodifiableMap(nestedTypes); return Collections.unmodifiableMap(nestedTypes);
} }


||||||
x
 
000:0
Loading…
Cancel
Save