From d5c6e6c69e678a79f9e8cd312e6007ad88026a36 Mon Sep 17 00:00:00 2001 From: Endi Sukma Dewata Date: Mon, 6 Feb 2012 15:44:34 -0600 Subject: Added generics (part 4). This patch brings down the warnings from 3427 to 2917. Ticket #2 --- .../cmscore/dbs/CRLIssuingPointRecord.java | 47 +++++++++++++--------- 1 file changed, 28 insertions(+), 19 deletions(-) (limited to 'pki/base/common/src/com/netscape/cmscore/dbs/CRLIssuingPointRecord.java') diff --git a/pki/base/common/src/com/netscape/cmscore/dbs/CRLIssuingPointRecord.java b/pki/base/common/src/com/netscape/cmscore/dbs/CRLIssuingPointRecord.java index 9f0797d40..0a3a46f14 100644 --- a/pki/base/common/src/com/netscape/cmscore/dbs/CRLIssuingPointRecord.java +++ b/pki/base/common/src/com/netscape/cmscore/dbs/CRLIssuingPointRecord.java @@ -23,6 +23,8 @@ import java.util.Enumeration; import java.util.Hashtable; import java.util.Vector; +import netscape.security.x509.RevokedCertificate; + import com.netscape.certsrv.apps.CMS; import com.netscape.certsrv.base.EBaseException; import com.netscape.certsrv.dbs.IDBObj; @@ -51,10 +53,10 @@ public class CRLIssuingPointRecord implements ICRLIssuingPointRecord, IDBObj { protected String mFirstUnsaved = null; protected byte mCRL[] = null; protected byte mCACert[] = null; - protected Hashtable mCRLCache = null; - protected Hashtable mRevokedCerts = null; - protected Hashtable mUnrevokedCerts = null; - protected Hashtable mExpiredCerts = null; + protected Hashtable mCRLCache = null; + protected Hashtable mRevokedCerts = null; + protected Hashtable mUnrevokedCerts = null; + protected Hashtable mExpiredCerts = null; protected byte mDeltaCRL[] = null; protected static Vector mNames = new Vector(); static { @@ -106,7 +108,9 @@ public class CRLIssuingPointRecord implements ICRLIssuingPointRecord, IDBObj { */ public CRLIssuingPointRecord(String id, BigInteger crlNumber, Long crlSize, Date thisUpdate, Date nextUpdate, BigInteger deltaCRLNumber, Long deltaCRLSize, - Hashtable revokedCerts, Hashtable unrevokedCerts, Hashtable expiredCerts) { + Hashtable revokedCerts, + Hashtable unrevokedCerts, + Hashtable expiredCerts) { mId = id; mCRLNumber = crlNumber; mCRLSize = crlSize; @@ -121,6 +125,7 @@ public class CRLIssuingPointRecord implements ICRLIssuingPointRecord, IDBObj { mExpiredCerts = expiredCerts; } + @SuppressWarnings({ "unchecked" }) public void set(String name, Object obj) throws EBaseException { if (name.equalsIgnoreCase(ATTR_ID)) { mId = (String) obj; @@ -143,13 +148,13 @@ public class CRLIssuingPointRecord implements ICRLIssuingPointRecord, IDBObj { } else if (name.equalsIgnoreCase(ATTR_CA_CERT)) { mCACert = (byte[]) obj; } else if (name.equalsIgnoreCase(ATTR_CRL_CACHE)) { - mCRLCache = (Hashtable) obj; + mCRLCache = (Hashtable) obj; } else if (name.equalsIgnoreCase(ATTR_REVOKED_CERTS)) { - mRevokedCerts = (Hashtable) obj; + mRevokedCerts = (Hashtable) obj; } else if (name.equalsIgnoreCase(ATTR_UNREVOKED_CERTS)) { - mUnrevokedCerts = (Hashtable) obj; + mUnrevokedCerts = (Hashtable) obj; } else if (name.equalsIgnoreCase(ATTR_EXPIRED_CERTS)) { - mExpiredCerts = (Hashtable) obj; + mExpiredCerts = (Hashtable) obj; } else if (name.equalsIgnoreCase(ATTR_DELTA_CRL)) { mDeltaCRL = (byte[]) obj; } else { @@ -279,47 +284,51 @@ public class CRLIssuingPointRecord implements ICRLIssuingPointRecord, IDBObj { return mCACert; } - public Hashtable getCRLCacheNoClone() { + public Hashtable getCRLCacheNoClone() { if (mCRLCache == null) return null; else - return (Hashtable) mCRLCache; + return mCRLCache; } - public Hashtable getCRLCache() { + @SuppressWarnings("unchecked") + public Hashtable getCRLCache() { if (mCRLCache == null) return null; else - return (Hashtable) mCRLCache.clone(); + return (Hashtable) mCRLCache.clone(); } /** * Retrieves cache info of revoked certificates. */ - public Hashtable getRevokedCerts() { + @SuppressWarnings("unchecked") + public Hashtable getRevokedCerts() { if (mRevokedCerts == null) return null; else - return (Hashtable) mRevokedCerts.clone(); + return (Hashtable) mRevokedCerts.clone(); } /** * Retrieves cache info of unrevoked certificates. */ - public Hashtable getUnrevokedCerts() { + @SuppressWarnings("unchecked") + public Hashtable getUnrevokedCerts() { if (mUnrevokedCerts == null) return null; else - return (Hashtable) mUnrevokedCerts.clone(); + return (Hashtable) mUnrevokedCerts.clone(); } /** * Retrieves cache info of expired certificates. */ - public Hashtable getExpiredCerts() { + @SuppressWarnings("unchecked") + public Hashtable getExpiredCerts() { if (mExpiredCerts == null) return null; else - return (Hashtable) mExpiredCerts.clone(); + return (Hashtable) mExpiredCerts.clone(); } } -- cgit