diff options
author | Lars Vogel | 2019-09-03 17:06:27 +0000 |
---|---|---|
committer | Lars Vogel | 2019-09-11 05:31:29 +0000 |
commit | d313383de36e6d619cce98d940bf9c3efbb1e724 (patch) | |
tree | b5cb520e0c0e5dd1bf7e5b409b1fdce39eb5c266 | |
parent | d610caa758aca82fa1e58801b3a36b9070f2d009 (diff) | |
download | rt.equinox.framework-d313383de36e6d619cce98d940bf9c3efbb1e724.tar.gz rt.equinox.framework-d313383de36e6d619cce98d940bf9c3efbb1e724.tar.xz rt.equinox.framework-d313383de36e6d619cce98d940bf9c3efbb1e724.zip |
Use HashMap in ManifestElement instead of HashTableI20190911-1805
Change-Id: I69caf7992433e438c69a1178f38920dcf43b8ff3
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
-rw-r--r-- | bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/util/ManifestElement.java | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/util/ManifestElement.java b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/util/ManifestElement.java index 93af0cf18..33a2cbf2b 100644 --- a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/util/ManifestElement.java +++ b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/util/ManifestElement.java @@ -19,9 +19,9 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; +import java.util.Collections; import java.util.Enumeration; import java.util.HashMap; -import java.util.Hashtable; import java.util.List; import java.util.Map; import java.util.StringTokenizer; @@ -102,12 +102,12 @@ public class ManifestElement { /** * The table of attributes for the manifest element. */ - private Hashtable<String, Object> attributes; + private HashMap<String, Object> attributes; /** * The table of directives for the manifest element. */ - private Hashtable<String, Object> directives; + private HashMap<String, Object> directives; /** * Constructs an empty manifest element with no value or attributes. @@ -260,12 +260,14 @@ public class ManifestElement { /* * Return the last value associated with the given key in the specified table. */ - private String getTableValue(Hashtable<String, Object> table, String key) { - if (table == null) + private String getTableValue(HashMap<String, Object> table, String key) { + if (table == null) { return null; + } Object result = table.get(key); - if (result == null) + if (result == null) { return null; + } if (result instanceof String) return (String) result; @@ -278,12 +280,14 @@ public class ManifestElement { /* * Return the values associated with the given key in the specified table. */ - private String[] getTableValues(Hashtable<String, Object> table, String key) { - if (table == null) + private String[] getTableValues(HashMap<String, Object> table, String key) { + if (table == null) { return null; + } Object result = table.get(key); - if (result == null) + if (result == null) { return null; + } if (result instanceof String) return new String[] {(String) result}; @SuppressWarnings("unchecked") @@ -294,10 +298,10 @@ public class ManifestElement { /* * Return an enumeration of table keys for the specified table. */ - private Enumeration<String> getTableKeys(Hashtable<String, Object> table) { + private Enumeration<String> getTableKeys(HashMap<String, Object> table) { if (table == null) return null; - return table.keys(); + return Collections.enumeration(table.keySet()); } /* @@ -306,9 +310,9 @@ public class ManifestElement { * append the new value to the end of the list. */ @SuppressWarnings("unchecked") - private Hashtable<String, Object> addTableValue(Hashtable<String, Object> table, String key, String value) { + private HashMap<String, Object> addTableValue(HashMap<String, Object> table, String key, String value) { if (table == null) { - table = new Hashtable<>(7); + table = new HashMap<>(7); } Object curValue = table.get(key); if (curValue != null) { |