diff options
author | Endi Sukma Dewata <edewata@redhat.com> | 2012-02-06 15:44:34 -0600 |
---|---|---|
committer | Endi Sukma Dewata <edewata@redhat.com> | 2012-02-14 16:32:25 -0600 |
commit | d5c6e6c69e678a79f9e8cd312e6007ad88026a36 (patch) | |
tree | 2e5934f2ff9aeb3b5014808799f2862ee262a723 /pki/base/common/src/com/netscape/cmscore/dbs/CertificateRepository.java | |
parent | a4979af45554d97190180a038a4b438e3161d609 (diff) | |
download | pki-d5c6e6c69e678a79f9e8cd312e6007ad88026a36.tar.gz pki-d5c6e6c69e678a79f9e8cd312e6007ad88026a36.tar.xz pki-d5c6e6c69e678a79f9e8cd312e6007ad88026a36.zip |
Added generics (part 4).
This patch brings down the warnings from 3427 to 2917.
Ticket #2
Diffstat (limited to 'pki/base/common/src/com/netscape/cmscore/dbs/CertificateRepository.java')
-rw-r--r-- | pki/base/common/src/com/netscape/cmscore/dbs/CertificateRepository.java | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/pki/base/common/src/com/netscape/cmscore/dbs/CertificateRepository.java b/pki/base/common/src/com/netscape/cmscore/dbs/CertificateRepository.java index 8b29dec53..6ae379840 100644 --- a/pki/base/common/src/com/netscape/cmscore/dbs/CertificateRepository.java +++ b/pki/base/common/src/com/netscape/cmscore/dbs/CertificateRepository.java @@ -45,6 +45,7 @@ import com.netscape.certsrv.ca.ICRLIssuingPoint; import com.netscape.certsrv.dbs.EDBException; import com.netscape.certsrv.dbs.IDBRegistry; import com.netscape.certsrv.dbs.IDBSSession; +import com.netscape.certsrv.dbs.IDBSearchResults; import com.netscape.certsrv.dbs.IDBSubsystem; import com.netscape.certsrv.dbs.IDBVirtualList; import com.netscape.certsrv.dbs.Modification; @@ -450,9 +451,6 @@ public class CertificateRepository extends Repository } } - CertRecord cRec = null; - BigInteger serial = null; - transitCertList(cList, CertRecord.STATUS_EXPIRED); } @@ -622,7 +620,6 @@ public class CertificateRepository extends Repository */ public X509CertImpl getX509Certificate(BigInteger serialNo) throws EBaseException { - X509CertImpl cert = null; ICertRecord cr = readCertificateRecord(serialNo); return (cr.getCertificate()); @@ -767,19 +764,22 @@ public class CertificateRepository extends Repository return e; } - public Enumeration<Object> searchCertificates(String filter, int maxSize, int timeLimit) + public Enumeration<ICertRecord> searchCertificates(String filter, int maxSize, int timeLimit) throws EBaseException { IDBSSession s = mDBService.createSession(); - Enumeration<Object> e = null; + Vector<ICertRecord> v = new Vector<ICertRecord>(); CMS.debug("searchCertificateswith time limit filter " + filter); try { - e = s.search(getDN(), filter, maxSize, timeLimit); + IDBSearchResults sr = s.search(getDN(), filter, maxSize, timeLimit); + while (sr.hasMoreElements()) { + v.add((ICertRecord) sr.nextElement()); + } } finally { if (s != null) s.close(); } - return e; + return v.elements(); } /** @@ -894,7 +894,7 @@ public class CertificateRepository extends Repository CertRecordList list = null; try { - IDBVirtualList<ICertRecord> vlist = s.createVirtualList(getDN(), filter, attrs, + IDBVirtualList<ICertRecord> vlist = s.<ICertRecord>createVirtualList(getDN(), filter, attrs, sortKey, pageSize); list = new CertRecordList(vlist); @@ -1212,7 +1212,7 @@ public class CertificateRepository extends Repository String fromVal = "0"; try { if (from != null) { - int fv = Integer.parseInt(from); + Integer.parseInt(from); fromVal = from; } } catch (Exception e1) { @@ -1515,8 +1515,6 @@ public class CertificateRepository extends Repository public ICertRecordList getInvalidCertsByNotBeforeDate(Date date, int pageSize) throws EBaseException { - String now = null; - Date rightNow = CMS.getCurrentDate(); ICertRecordList list = null; @@ -1555,8 +1553,6 @@ public class CertificateRepository extends Repository public ICertRecordList getValidCertsByNotAfterDate(Date date, int pageSize) throws EBaseException { - String now = null; - ICertRecordList list = null; IDBSSession s = mDBService.createSession(); |