diff options
author | Adam Young <ayoung@redhat.com> | 2011-12-05 17:15:56 -0500 |
---|---|---|
committer | Adam Young <ayoung@redhat.com> | 2011-12-07 12:30:49 -0500 |
commit | 948bfab248d4cb1faf00c5999f8a55580e89999f (patch) | |
tree | ff8f037c8841291b27cb7841d1ed4076928aa04b /pki/base/util/src/netscape/security/x509/X509CertInfo.java | |
parent | ec45d246502d8dedb59a97c4599d26657c464e56 (diff) | |
download | pki-948bfab248d4cb1faf00c5999f8a55580e89999f.tar.gz pki-948bfab248d4cb1faf00c5999f8a55580e89999f.tar.xz pki-948bfab248d4cb1faf00c5999f8a55580e89999f.zip |
TreeSet
ArraySet and AttributeNameEnumeration both were not updated to handfle Generics.
Neither are really needed, and are likely to introduce errors.
ArraySet can be safely replaced by TreeSet.
TreeSet provides a stricter ordering constraint than ArraySet did.
This will not hurt anything, and may actually be closer to the desired behavior
AttributeNameEnumeration was a thin wrapper around Vector.
It has been replaced with Vector<String>
In addition, this patch cleans up the Type safety in of the collections used in the related files.
removed files from cmake
Removed custom collection files
Supressed watnings generated by the clone method.
Diffstat (limited to 'pki/base/util/src/netscape/security/x509/X509CertInfo.java')
-rw-r--r-- | pki/base/util/src/netscape/security/x509/X509CertInfo.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/pki/base/util/src/netscape/security/x509/X509CertInfo.java b/pki/base/util/src/netscape/security/x509/X509CertInfo.java index 0e58a10b1..4ece0df82 100644 --- a/pki/base/util/src/netscape/security/x509/X509CertInfo.java +++ b/pki/base/util/src/netscape/security/x509/X509CertInfo.java @@ -28,6 +28,7 @@ import java.security.cert.CertificateException; import java.security.cert.CertificateParsingException; import java.util.Enumeration; import java.util.Hashtable; +import java.util.Vector; import netscape.security.util.DerInputStream; import netscape.security.util.DerOutputStream; @@ -116,7 +117,7 @@ public class X509CertInfo implements CertAttrSet, Serializable { private byte[] rawCertInfo = null; // The certificate attribute name to integer mapping stored here - private static final Hashtable map = new Hashtable(); + private static final Hashtable<String, Integer> map = new Hashtable<String, Integer>(); static { map.put(VERSION, Integer.valueOf(ATTR_VERSION)); map.put(SERIAL_NUMBER, Integer.valueOf(ATTR_SERIAL)); @@ -221,8 +222,8 @@ public class X509CertInfo implements CertAttrSet, Serializable { * Return an enumeration of names of attributes existing within this * attribute. */ - public Enumeration getElements() { - AttributeNameEnumeration elements = new AttributeNameEnumeration(); + public Enumeration<String> getElements() { + Vector<String> elements = new Vector<String>(); elements.addElement(VERSION); elements.addElement(SERIAL_NUMBER); elements.addElement(ALGORITHM_ID); @@ -806,7 +807,7 @@ public class X509CertInfo implements CertAttrSet, Serializable { * Returns the integer attribute number for the passed attribute name. */ private int attributeMap(String name) { - Integer num = (Integer)map.get(name); + Integer num = map.get(name); if (num == null) { return(0); } |