>From 6f06400fc118ad71f03d71afd16474105ba73f98 Mon Sep 17 00:00:00 2001
From: Adam Young <ayoung@redhat.com>
Date: Wed, 16 Nov 2011 16:21:56 -0500
Subject: [PATCH 33/38] type safety cleanup in common.

---
 .../netscape/cms/publish/mappers/AVAPattern.java   |    5 +++--
 .../cms/publish/mappers/LdapCaSimpleMap.java       |    8 ++++----
 .../cms/publish/mappers/LdapCertCompsMap.java      |    8 ++++----
 .../cms/publish/mappers/LdapCertExactMap.java      |    8 ++++----
 .../cms/publish/mappers/LdapCertSubjMap.java       |   14 +++++++-------
 .../cms/publish/mappers/LdapDNCompsMap.java        |   19 ++++++++-----------
 6 files changed, 30 insertions(+), 32 deletions(-)

diff --git a/pki/base/common/src/com/netscape/cms/publish/mappers/AVAPattern.java b/pki/base/common/src/com/netscape/cms/publish/mappers/AVAPattern.java
index 9f337cbb435d6540976aa5b4105d1fa8d30391cb..d7d496d46681884ae1b980bfb6d6f0ed8fd574db 100644
--- a/pki/base/common/src/com/netscape/cms/publish/mappers/AVAPattern.java
+++ b/pki/base/common/src/com/netscape/cms/publish/mappers/AVAPattern.java
@@ -37,6 +37,7 @@ import netscape.ldap.LDAPDN;
 import netscape.security.x509.CertificateExtensions;
 import netscape.security.x509.Extension;
 import netscape.security.x509.GeneralName;
+import netscape.security.x509.GeneralNameInterface;
 import netscape.security.x509.GeneralNames;
 import netscape.security.x509.LdapV3DNStrConverter;
 import netscape.security.x509.OIDMap;
@@ -459,7 +460,7 @@ class AVAPattern {
 
                                 int j = 0;
 
-                                for (Enumeration n =
+                                for (Enumeration<GeneralNameInterface> n =
                                         subjectNames.elements();
                                     n.hasMoreElements();) {
 
@@ -561,7 +562,7 @@ class AVAPattern {
             return new String[] { rdn };
         }
 
-        Vector avas = new Vector();
+        Vector<String> avas = new Vector<String>();
 
         StringTokenizer token = new StringTokenizer(rdn, "+");
 
diff --git a/pki/base/common/src/com/netscape/cms/publish/mappers/LdapCaSimpleMap.java b/pki/base/common/src/com/netscape/cms/publish/mappers/LdapCaSimpleMap.java
index 9f605678e00770663bfd046b0315266d36a30259..3cf1bca82a446de11e1ea53557a0048e8496af18 100644
--- a/pki/base/common/src/com/netscape/cms/publish/mappers/LdapCaSimpleMap.java
+++ b/pki/base/common/src/com/netscape/cms/publish/mappers/LdapCaSimpleMap.java
@@ -348,16 +348,16 @@ public class LdapCaSimpleMap implements ILdapMapper, IExtendedPluginInfo {
         return "LdapCaSimpleMap";
     }
 
-    public Vector getDefaultParams() {
-        Vector v = new Vector();
+    public Vector<String> getDefaultParams() {
+        Vector<String> v = new Vector<String>();
 
         v.addElement(PROP_DNPATTERN + "=");
         v.addElement(PROP_CREATECA + "=true");
         return v;
     }
 
-    public Vector getInstanceParams() {
-        Vector v = new Vector();
+    public Vector<String> getInstanceParams() {
+        Vector<String> v = new Vector<String>();
 
         try {
             if (mDnPattern == null) {
diff --git a/pki/base/common/src/com/netscape/cms/publish/mappers/LdapCertCompsMap.java b/pki/base/common/src/com/netscape/cms/publish/mappers/LdapCertCompsMap.java
index b8cc06f7775dbb6bb7b787d5f2415387110953ca..17c562ce167cbf4f819a9706575a562a626510c1 100644
--- a/pki/base/common/src/com/netscape/cms/publish/mappers/LdapCertCompsMap.java
+++ b/pki/base/common/src/com/netscape/cms/publish/mappers/LdapCertCompsMap.java
@@ -84,14 +84,14 @@ public class LdapCertCompsMap
         return "LdapCertCompsMap";
     }
 
-    public Vector getDefaultParams() {
-        Vector v = super.getDefaultParams();
+    public Vector<String> getDefaultParams() {
+        Vector<String> v = super.getDefaultParams();
 
         return v;
     }
 
-    public Vector getInstanceParams() {
-        Vector v = super.getInstanceParams();
+    public Vector<String> getInstanceParams() {
+        Vector<String> v = super.getInstanceParams();
 
         return v;
     }
diff --git a/pki/base/common/src/com/netscape/cms/publish/mappers/LdapCertExactMap.java b/pki/base/common/src/com/netscape/cms/publish/mappers/LdapCertExactMap.java
index 7ce49748a8f7e9f83de3e690b12526c3db495c1d..7eded9cdd6c4bd72c62536844334cfd42e2f385f 100644
--- a/pki/base/common/src/com/netscape/cms/publish/mappers/LdapCertExactMap.java
+++ b/pki/base/common/src/com/netscape/cms/publish/mappers/LdapCertExactMap.java
@@ -90,14 +90,14 @@ public class LdapCertExactMap implements ILdapMapper, IExtendedPluginInfo {
         return "LdapCertExactMap";
     }
 
-    public Vector getDefaultParams() {
-        Vector v = new Vector();
+    public Vector<String> getDefaultParams() {
+        Vector<String> v = new Vector<String>();
 
         return v;
     }
 	
-    public Vector getInstanceParams() {
-        Vector v = new Vector();
+    public Vector<String> getInstanceParams() {
+        Vector<String> v = new Vector<String>();
 
         return v;
     }
diff --git a/pki/base/common/src/com/netscape/cms/publish/mappers/LdapCertSubjMap.java b/pki/base/common/src/com/netscape/cms/publish/mappers/LdapCertSubjMap.java
index 017441df033461bfdcdb98e9f2b3990c38bb4c79..42db2b2793e2600edf44efd905fc9017397a12bd 100644
--- a/pki/base/common/src/com/netscape/cms/publish/mappers/LdapCertSubjMap.java
+++ b/pki/base/common/src/com/netscape/cms/publish/mappers/LdapCertSubjMap.java
@@ -113,8 +113,8 @@ public class LdapCertSubjMap implements ILdapMapper, IExtendedPluginInfo {
         return "LdapCertSubjMap";
     }
 
-    public Vector getDefaultParams() {
-        Vector v = new Vector();
+    public Vector<String> getDefaultParams() {
+        Vector<String> v = new Vector<String>();
 
         v.addElement("certSubjNameAttr=" + mCertSubjNameAttr);
         v.addElement("searchBase=");
@@ -137,8 +137,8 @@ public class LdapCertSubjMap implements ILdapMapper, IExtendedPluginInfo {
         return params;
     }
 	
-    public Vector getInstanceParams() {
-        Vector v = new Vector();
+    public Vector<String> getInstanceParams() {
+        Vector<String> v = new Vector<String>();
 
         if (mCertSubjNameAttr == null) {
             v.addElement("certSubjNameAttr=");
@@ -263,9 +263,9 @@ public class LdapCertSubjMap implements ILdapMapper, IExtendedPluginInfo {
         return map(conn, obj);
     }
 
-    public Vector mapAll(LDAPConnection conn, Object obj)
+    public Vector<String> mapAll(LDAPConnection conn, Object obj)
         throws ELdapException {
-        Vector v = new Vector();
+        Vector<String> v = new Vector<String>();
 
         if (conn == null)
             return null;
@@ -315,7 +315,7 @@ public class LdapCertSubjMap implements ILdapMapper, IExtendedPluginInfo {
         return v;
     }
 
-    public Vector mapAll(LDAPConnection conn, IRequest req, Object obj)
+    public Vector<String> mapAll(LDAPConnection conn, IRequest req, Object obj)
         throws ELdapException {
         return mapAll(conn, obj);
     }
diff --git a/pki/base/common/src/com/netscape/cms/publish/mappers/LdapDNCompsMap.java b/pki/base/common/src/com/netscape/cms/publish/mappers/LdapDNCompsMap.java
index 1662283f3f2590289b3b903f7752b5f3cfb216e4..a9df7dae29217fdb5e3c250fe7b9c0917395abf3 100644
--- a/pki/base/common/src/com/netscape/cms/publish/mappers/LdapDNCompsMap.java
+++ b/pki/base/common/src/com/netscape/cms/publish/mappers/LdapDNCompsMap.java
@@ -142,8 +142,8 @@ public class LdapDNCompsMap
         return s;
     }
 
-    public Vector getDefaultParams() {
-        Vector v = new Vector();
+    public Vector<String> getDefaultParams() {
+        Vector<String> v = new Vector<String>();
 
         v.addElement("baseDN=");
         v.addElement("dnComps=");
@@ -151,8 +151,8 @@ public class LdapDNCompsMap
         return v;
     }
 
-    public Vector getInstanceParams() {
-        Vector v = new Vector();
+    public Vector<String> getInstanceParams() {
+        Vector<String> v = new Vector<String>();
 
         try {
             if (mBaseDN == null) {
@@ -307,7 +307,7 @@ public class LdapDNCompsMap
      */
     public String[] formDNandFilter(X500Name subjName)
         throws ELdapException {
-        Vector dnRdns = new Vector();
+        Vector<RDN> dnRdns = new Vector<RDN>();
         SearchFilter filter = new SearchFilter();
         X500NameAttrMap attrMap = X500NameAttrMap.getDefault();
         String dnStr = null, filterStr = null;
@@ -316,7 +316,7 @@ public class LdapDNCompsMap
 
         try {
             // get the base DN & filter.
-            for (Enumeration n = subjName.getRDNs(); n.hasMoreElements();) {
+            for (Enumeration<RDN> n = subjName.getRDNs(); n.hasMoreElements();) {
                 RDN rdn = (RDN) n.nextElement();
                 // NOTE assumes one AVA per RDN.
                 AVA ava = rdn.getAssertion()[0];
@@ -389,12 +389,9 @@ public class LdapDNCompsMap
      * class for forming search filters for ldap searching from 
      * name=value components. components are anded.
      */
-    public static class SearchFilter extends Vector {
-        /**
-         *
-         */
+
+    public static class SearchFilter extends Vector<Object> {
         private static final long serialVersionUID = 4210302171279891828L;
-
         public String toFilterString() {
             StringBuffer buf = new StringBuffer();
 
-- 
1.7.7.3

