diff options
Diffstat (limited to 'pki/base/common/src/com/netscape/cmscore')
5 files changed, 15 insertions, 17 deletions
diff --git a/pki/base/common/src/com/netscape/cmscore/dbs/CertRecord.java b/pki/base/common/src/com/netscape/cmscore/dbs/CertRecord.java index 321ce618..973ddc4f 100644 --- a/pki/base/common/src/com/netscape/cmscore/dbs/CertRecord.java +++ b/pki/base/common/src/com/netscape/cmscore/dbs/CertRecord.java @@ -61,7 +61,7 @@ public class CertRecord implements IDBObj, ICertRecord { private String mRevokedBy = null; private Date mRevokedOn = null; - protected static Vector mNames = new Vector(); + protected static Vector<String> mNames = new Vector<String>(); static { mNames.addElement(ATTR_ID); mNames.addElement(ATTR_META_INFO); @@ -166,11 +166,11 @@ public class CertRecord implements IDBObj, ICertRecord { throw new EBaseException(CMS.getUserMessage("CMS_BASE_INVALID_ATTRIBUTE", name)); } - public Enumeration getElements() { + public Enumeration<String> getElements() { return mNames.elements(); } - public Enumeration getSerializableAttrNames() { + public Enumeration<String> getSerializableAttrNames() { return mNames.elements(); } diff --git a/pki/base/common/src/com/netscape/cmscore/dbs/DBSearchResults.java b/pki/base/common/src/com/netscape/cmscore/dbs/DBSearchResults.java index c515b330..8b5098dc 100644 --- a/pki/base/common/src/com/netscape/cmscore/dbs/DBSearchResults.java +++ b/pki/base/common/src/com/netscape/cmscore/dbs/DBSearchResults.java @@ -40,13 +40,13 @@ import com.netscape.certsrv.logging.ILogger; public class DBSearchResults implements IDBSearchResults { private IDBRegistry mRegistry = null; - private Enumeration mRes = null; + private Enumeration<Object> mRes = null; private ILogger mLogger = CMS.getLogger(); /** * Constructs search results. */ - public DBSearchResults(IDBRegistry registry, Enumeration res) { + public DBSearchResults(IDBRegistry registry, Enumeration<Object> res) { mRegistry = registry; mRes = res; } diff --git a/pki/base/common/src/com/netscape/cmscore/dbs/KeyRepository.java b/pki/base/common/src/com/netscape/cmscore/dbs/KeyRepository.java index 6d4e4688..f684718c 100644 --- a/pki/base/common/src/com/netscape/cmscore/dbs/KeyRepository.java +++ b/pki/base/common/src/com/netscape/cmscore/dbs/KeyRepository.java @@ -22,7 +22,6 @@ import java.math.BigInteger; import java.security.PublicKey; import java.util.Date; import java.util.Enumeration; -import java.util.Vector; import netscape.security.x509.X500Name; @@ -178,9 +177,9 @@ public class KeyRepository extends Repository implements IKeyRepository { IKeyRecordList list = findKeyRecordsInList(filter, null, "serialno", 10); int size = list.getSize(); - Enumeration e = list.getKeyRecords(0, size - 1); + Enumeration<IKeyRecord> e = list.getKeyRecords(0, size - 1); while (e.hasMoreElements()) { - KeyRecord rec = (KeyRecord) e.nextElement(); + IKeyRecord rec = e.nextElement(); deleteKeyRecord(rec.getSerialNumber()); } } @@ -353,10 +352,10 @@ CMS.debug("filter= " + filter); return result; } - public Enumeration searchKeys(String filter, int maxSize) + public Enumeration<Object> searchKeys(String filter, int maxSize) throws EBaseException { IDBSSession s = mDBService.createSession(); - Enumeration e = null; + Enumeration<Object> e = null; try { e = s.search(getDN(), filter, maxSize); @@ -367,10 +366,10 @@ CMS.debug("filter= " + filter); return e; } - public Enumeration searchKeys(String filter, int maxSize, int timeLimit) + public Enumeration<Object> searchKeys(String filter, int maxSize, int timeLimit) throws EBaseException { IDBSSession s = mDBService.createSession(); - Enumeration e = null; + Enumeration<Object> e = null; try { e = s.search(getDN(), filter, maxSize, timeLimit); @@ -469,8 +468,6 @@ CMS.debug("filter= " + filter); } int ltSize = recList.getSizeBeforeJumpTo(); - Vector cList = new Vector(ltSize); - CMS.debug("KeyRepository:getLastSerialNumberInRange: ltSize " + ltSize); int i; diff --git a/pki/base/common/src/com/netscape/cmscore/dbs/ObjectStreamMapper.java b/pki/base/common/src/com/netscape/cmscore/dbs/ObjectStreamMapper.java index cb5e4cb6..46979715 100644 --- a/pki/base/common/src/com/netscape/cmscore/dbs/ObjectStreamMapper.java +++ b/pki/base/common/src/com/netscape/cmscore/dbs/ObjectStreamMapper.java @@ -48,7 +48,7 @@ import com.netscape.certsrv.logging.ILogger; public class ObjectStreamMapper implements IDBAttrMapper { private String mLdapName = null; - private Vector v = new Vector(); + private Vector<String> v = new Vector<String>(); private ILogger mLogger = CMS.getLogger(); /** @@ -62,7 +62,7 @@ public class ObjectStreamMapper implements IDBAttrMapper { /** * Retrieves a list of supported ldap attributes. */ - public Enumeration getSupportedLDAPAttributeNames() { + public Enumeration<String> getSupportedLDAPAttributeNames() { return v.elements(); } diff --git a/pki/base/common/src/com/netscape/cmscore/request/RequestRecord.java b/pki/base/common/src/com/netscape/cmscore/request/RequestRecord.java index 99764b91..321e32ec 100644 --- a/pki/base/common/src/com/netscape/cmscore/request/RequestRecord.java +++ b/pki/base/common/src/com/netscape/cmscore/request/RequestRecord.java @@ -103,7 +103,8 @@ public class RequestRecord } // IDBObj.set - public void set(String name, Object o) { + @SuppressWarnings("unchecked") + public void set(String name, Object o) { if (name.equals(IRequestRecord.ATTR_REQUEST_ID)) mRequestId = (RequestId) o; else if (name.equals(IRequestRecord.ATTR_REQUEST_STATE)) |