summaryrefslogtreecommitdiffstats
path: root/pki/base/util/src/netscape/security/pkcs/PKCS10Attributes.java
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2012-01-12 23:25:43 -0600
committerEndi Sukma Dewata <edewata@redhat.com>2012-01-18 12:56:06 -0600
commit84e512223229b2d54e1a04b7899f888732c8fdba (patch)
tree33c022adbd60ce1103d0f0c97fcfc1e229a86643 /pki/base/util/src/netscape/security/pkcs/PKCS10Attributes.java
parent2a535f04f7b7bf670b19b95801e25178af5c91f9 (diff)
downloadpki-84e512223229b2d54e1a04b7899f888732c8fdba.tar.gz
pki-84e512223229b2d54e1a04b7899f888732c8fdba.tar.xz
pki-84e512223229b2d54e1a04b7899f888732c8fdba.zip
Added generics (part 2).
This patch brings down the warnings from 4648 to 3992. Ticket #2
Diffstat (limited to 'pki/base/util/src/netscape/security/pkcs/PKCS10Attributes.java')
-rw-r--r--pki/base/util/src/netscape/security/pkcs/PKCS10Attributes.java32
1 files changed, 16 insertions, 16 deletions
diff --git a/pki/base/util/src/netscape/security/pkcs/PKCS10Attributes.java b/pki/base/util/src/netscape/security/pkcs/PKCS10Attributes.java
index 46b309cc7..8beb1e64c 100644
--- a/pki/base/util/src/netscape/security/pkcs/PKCS10Attributes.java
+++ b/pki/base/util/src/netscape/security/pkcs/PKCS10Attributes.java
@@ -35,19 +35,19 @@ import netscape.security.util.DerValue;
* @author Hemma Prafullchandra
* @version 1.10
*/
-public class PKCS10Attributes extends Vector implements DerEncoder {
+public class PKCS10Attributes extends Vector<PKCS10Attribute> implements DerEncoder {
/**
*
*/
private static final long serialVersionUID = 1362260612357629542L;
- private Hashtable map;
+ private Hashtable<String, PKCS10Attribute> map;
/**
* Default constructor for the certificate attribute.
*/
public PKCS10Attributes() {
- map = new Hashtable();
+ map = new Hashtable<String, PKCS10Attribute>();
}
/**
@@ -59,7 +59,7 @@ public class PKCS10Attributes extends Vector implements DerEncoder {
public PKCS10Attributes(DerInputStream in)
throws IOException {
- map = new Hashtable();
+ map = new Hashtable<String, PKCS10Attribute>();
DerValue[] attrs = in.getSet(5, true);
if (attrs != null) {
@@ -107,41 +107,41 @@ public class PKCS10Attributes extends Vector implements DerEncoder {
/**
* Set the attribute value.
*/
- public void setAttribute(String name, Object obj) throws IOException {
- map.put(name, obj);
- addElement(obj);
+ public void setAttribute(String name, PKCS10Attribute attr) throws IOException {
+ map.put(name, attr);
+ addElement(attr);
}
/**
* Get the attribute value.
*/
- public Object getAttribute(String name) throws IOException {
- Object obj = map.get(name);
+ public PKCS10Attribute getAttribute(String name) throws IOException {
+ PKCS10Attribute attr = map.get(name);
/*
- if (obj == null) {
+ if (attr == null) {
throw new IOException("No attribute found with name " + name);
}
*/
- return (obj);
+ return (attr);
}
/**
* Delete the attribute value.
*/
public void deleteAttribute(String name) throws IOException {
- Object obj = map.get(name);
- if (obj == null) {
+ PKCS10Attribute attr = map.get(name);
+ if (attr == null) {
throw new IOException("No attribute found with name " + name);
}
map.remove(name);
- removeElement(obj);
+ removeElement(attr);
}
/**
* Return an enumeration of names of attributes existing within this
* attribute.
*/
- public Enumeration getElements() {
- return (map.elements());
+ public Enumeration<PKCS10Attribute> getElements() {
+ return map.elements();
}
}