diff options
Diffstat (limited to 'pki/base/common/src/com/netscape/cmscore/dbs')
13 files changed, 82 insertions, 81 deletions
diff --git a/pki/base/common/src/com/netscape/cmscore/dbs/ByteArrayMapper.java b/pki/base/common/src/com/netscape/cmscore/dbs/ByteArrayMapper.java index a51905c79..38362f341 100644 --- a/pki/base/common/src/com/netscape/cmscore/dbs/ByteArrayMapper.java +++ b/pki/base/common/src/com/netscape/cmscore/dbs/ByteArrayMapper.java @@ -39,7 +39,7 @@ import com.netscape.certsrv.dbs.IDBObj; public class ByteArrayMapper implements IDBAttrMapper { private String mLdapName = null; - private Vector v = new Vector(); + private Vector<String> v = new Vector<String>(); /** * Constructs a byte array mapper. @@ -52,7 +52,7 @@ public class ByteArrayMapper implements IDBAttrMapper { /** * Lists a list of supported ldap attribute names. */ - public Enumeration getSupportedLDAPAttributeNames() { + public Enumeration<String> getSupportedLDAPAttributeNames() { return v.elements(); } 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 df44797f1..9f0797d40 100644 --- a/pki/base/common/src/com/netscape/cmscore/dbs/CRLIssuingPointRecord.java +++ b/pki/base/common/src/com/netscape/cmscore/dbs/CRLIssuingPointRecord.java @@ -56,7 +56,7 @@ public class CRLIssuingPointRecord implements ICRLIssuingPointRecord, IDBObj { protected Hashtable mUnrevokedCerts = null; protected Hashtable mExpiredCerts = null; protected byte mDeltaCRL[] = null; - protected static Vector mNames = new Vector(); + protected static Vector<String> mNames = new Vector<String>(); static { mNames.addElement(ATTR_ID); mNames.addElement(ATTR_CRL_NUMBER); @@ -197,11 +197,11 @@ public class CRLIssuingPointRecord implements ICRLIssuingPointRecord, IDBObj { 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/CertRecordMapper.java b/pki/base/common/src/com/netscape/cmscore/dbs/CertRecordMapper.java index 3f5895ade..f4074c213 100644 --- a/pki/base/common/src/com/netscape/cmscore/dbs/CertRecordMapper.java +++ b/pki/base/common/src/com/netscape/cmscore/dbs/CertRecordMapper.java @@ -49,8 +49,8 @@ public class CertRecordMapper implements IDBAttrMapper { mDB = db; } - public Enumeration getSupportedLDAPAttributeNames() { - Vector v = new Vector(); + public Enumeration<String> getSupportedLDAPAttributeNames() { + Vector<String> v = new Vector<String>(); v.addElement(CertDBSchema.LDAP_ATTR_CERT_RECORD_ID); return v.elements(); 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 9ee5be524..8b29dec53 100644 --- a/pki/base/common/src/com/netscape/cmscore/dbs/CertificateRepository.java +++ b/pki/base/common/src/com/netscape/cmscore/dbs/CertificateRepository.java @@ -752,10 +752,10 @@ public class CertificateRepository extends Repository modifyCertificateRecord(id, mods); } - public Enumeration searchCertificates(String filter, int maxSize) + public Enumeration<Object> searchCertificates(String filter, int maxSize) throws EBaseException { IDBSSession s = mDBService.createSession(); - Enumeration e = null; + Enumeration<Object> e = null; CMS.debug("searchCertificates filter " + filter + " maxSize " + maxSize); try { @@ -767,10 +767,10 @@ public class CertificateRepository extends Repository return e; } - public Enumeration searchCertificates(String filter, int maxSize, int timeLimit) + public Enumeration<Object> searchCertificates(String filter, int maxSize, int timeLimit) throws EBaseException { IDBSSession s = mDBService.createSession(); - Enumeration e = null; + Enumeration<Object> e = null; CMS.debug("searchCertificateswith time limit filter " + filter); try { @@ -787,11 +787,11 @@ public class CertificateRepository extends Repository * * @deprecated replaced by <code>findCertificatesInList</code> */ - public Enumeration findCertRecs(String filter) + public Enumeration<Object> findCertRecs(String filter) throws EBaseException { CMS.debug("findCertRecs " + filter); IDBSSession s = mDBService.createSession(); - Enumeration e = null; + Enumeration<Object> e = null; try { e = s.search(getDN(), filter); } finally { @@ -801,13 +801,13 @@ public class CertificateRepository extends Repository return e; } - public Enumeration findCertRecs(String filter, String[] attrs) + public Enumeration<Object> findCertRecs(String filter, String[] attrs) throws EBaseException { CMS.debug("findCertRecs " + filter + "attrs " + Arrays.toString(attrs)); IDBSSession s = mDBService.createSession(); - Enumeration e = null; + Enumeration<Object> e = null; try { e = s.search(getDN(), filter, attrs); } finally { @@ -820,11 +820,11 @@ public class CertificateRepository extends Repository public Enumeration<X509CertImpl> findCertificates(String filter) throws EBaseException { - Enumeration e = findCertRecords(filter); + Enumeration<ICertRecord> e = findCertRecords(filter); Vector<X509CertImpl> v = new Vector<X509CertImpl>(); while (e.hasMoreElements()) { - CertRecord rec = (CertRecord) e.nextElement(); + ICertRecord rec = e.nextElement(); v.addElement(rec.getCertificate()); } @@ -837,10 +837,10 @@ public class CertificateRepository extends Repository * If you are going to process everything in the list, * use this. */ - public Enumeration findCertRecords(String filter) + public Enumeration<ICertRecord> findCertRecords(String filter) throws EBaseException { IDBSSession s = mDBService.createSession(); - Enumeration e = null; + Enumeration<ICertRecord> e = null; try { //e = s.search(getDN(), filter); @@ -1066,7 +1066,7 @@ public class CertificateRepository extends Repository list = findCertRecordsInList(filter, null, "serialno", 10); int size = list.getSize(); - Enumeration e = list.getCertRecords(0, size - 1); + Enumeration<ICertRecord> e = list.getCertRecords(0, size - 1); tab = new Hashtable<String, RenewableCertificateCollection>(); while (e.hasMoreElements()) { @@ -1134,7 +1134,7 @@ public class CertificateRepository extends Repository list = findCertRecordsInList(filter, null, "serialno", 10); int size = list.getSize(); - Enumeration e = list.getCertRecords(0, size - 1); + Enumeration<ICertRecord> e = list.getCertRecords(0, size - 1); Vector<X509CertImpl> v = new Vector<X509CertImpl>(); @@ -1161,7 +1161,7 @@ public class CertificateRepository extends Repository X509CertImpl certs[] = null; try { - Enumeration e = null; + Enumeration<ICertRecord> e = null; if (filter != null && filter.length() > 0) { //e = s.search(getDN(), filter); @@ -1197,10 +1197,10 @@ public class CertificateRepository extends Repository * @param from The starting point of the serial number range. * @param to The ending point of the serial number range. */ - public Enumeration<CertRecord> getValidCertificates(String from, String to) + public Enumeration<ICertRecord> getValidCertificates(String from, String to) throws EBaseException { IDBSSession s = mDBService.createSession(); - Vector<CertRecord> v = new Vector<CertRecord>(); + Vector<ICertRecord> v = new Vector<ICertRecord>(); try { @@ -1256,10 +1256,10 @@ public class CertificateRepository extends Repository /** * Retrives all valid certificates excluding ones already revoked. */ - public Enumeration getAllValidCertificates() + public Enumeration<ICertRecord> getAllValidCertificates() throws EBaseException { IDBSSession s = mDBService.createSession(); - Enumeration e = null; + Enumeration<ICertRecord> e = null; try { Date now = CMS.getCurrentDate(); @@ -1293,10 +1293,10 @@ public class CertificateRepository extends Repository * @param from The starting point of the serial number range. * @param to The ending point of the serial number range. */ - public Enumeration getValidNotPublishedCertificates(String from, String to) + public Enumeration<ICertRecord> getValidNotPublishedCertificates(String from, String to) throws EBaseException { IDBSSession s = mDBService.createSession(); - Enumeration e = null; + Enumeration<ICertRecord> e = null; try { Date now = CMS.getCurrentDate(); @@ -1335,10 +1335,10 @@ public class CertificateRepository extends Repository * Retrives all valid not published certificates * excluding ones already revoked. */ - public Enumeration getAllValidNotPublishedCertificates() + public Enumeration<ICertRecord> getAllValidNotPublishedCertificates() throws EBaseException { IDBSSession s = mDBService.createSession(); - Enumeration e = null; + Enumeration<ICertRecord> e = null; try { Date now = CMS.getCurrentDate(); @@ -1374,10 +1374,10 @@ public class CertificateRepository extends Repository * @param from The starting point of the serial number range. * @param to The ending point of the serial number range. */ - public Enumeration getExpiredCertificates(String from, String to) + public Enumeration<ICertRecord> getExpiredCertificates(String from, String to) throws EBaseException { IDBSSession s = mDBService.createSession(); - Enumeration e = null; + Enumeration<ICertRecord> e = null; try { Date now = CMS.getCurrentDate(); @@ -1409,10 +1409,10 @@ public class CertificateRepository extends Repository /** * Retrives all expired certificates. */ - public Enumeration getAllExpiredCertificates() + public Enumeration<ICertRecord> getAllExpiredCertificates() throws EBaseException { IDBSSession s = mDBService.createSession(); - Enumeration e = null; + Enumeration<ICertRecord> e = null; try { Date now = CMS.getCurrentDate(); @@ -1441,10 +1441,10 @@ public class CertificateRepository extends Repository * @param from The starting point of the serial number range. * @param to The ending point of the serial number range. */ - public Enumeration getExpiredPublishedCertificates(String from, String to) + public Enumeration<ICertRecord> getExpiredPublishedCertificates(String from, String to) throws EBaseException { IDBSSession s = mDBService.createSession(); - Enumeration e = null; + Enumeration<ICertRecord> e = null; try { Date now = CMS.getCurrentDate(); @@ -1480,10 +1480,10 @@ public class CertificateRepository extends Repository /** * Retrives all expired publishedcertificates. */ - public Enumeration getAllExpiredPublishedCertificates() + public Enumeration<ICertRecord> getAllExpiredPublishedCertificates() throws EBaseException { IDBSSession s = mDBService.createSession(); - Enumeration e = null; + Enumeration<ICertRecord> e = null; try { Date now = CMS.getCurrentDate(); @@ -1621,10 +1621,10 @@ public class CertificateRepository extends Repository * @param from The starting point of the serial number range. * @param to The ending point of the serial number range. */ - public Enumeration getRevokedCertificates(String from, String to) + public Enumeration<ICertRecord> getRevokedCertificates(String from, String to) throws EBaseException { IDBSSession s = mDBService.createSession(); - Enumeration e = null; + Enumeration<ICertRecord> e = null; try { String ldapfilter = "(&(" + CertRecord.ATTR_REVO_INFO + "=*)"; @@ -1653,10 +1653,10 @@ public class CertificateRepository extends Repository * Retrives all revoked certificates including ones already expired or * not yet valid. */ - public Enumeration getAllRevokedCertificates() + public Enumeration<ICertRecord> getAllRevokedCertificates() throws EBaseException { IDBSSession s = mDBService.createSession(); - Enumeration e = null; + Enumeration<ICertRecord> e = null; // index is setup for this filter String ldapfilter = "(|(" + CertRecord.ATTR_CERT_STATUS + "=" + CertRecord.STATUS_REVOKED + ")(" + CertRecord.ATTR_CERT_STATUS + "=" + CertRecord.STATUS_REVOKED_EXPIRED + "))"; @@ -1682,10 +1682,10 @@ public class CertificateRepository extends Repository * @param from The starting point of the serial number range. * @param to The ending point of the serial number range. */ - public Enumeration getRevokedPublishedCertificates(String from, String to) + public Enumeration<ICertRecord> getRevokedPublishedCertificates(String from, String to) throws EBaseException { IDBSSession s = mDBService.createSession(); - Enumeration e = null; + Enumeration<ICertRecord> e = null; try { String ldapfilter = "(&(" + CertRecord.ATTR_REVO_INFO + "=*)"; @@ -1717,10 +1717,10 @@ public class CertificateRepository extends Repository * Retrives all revoked published certificates including ones * already expired or not yet valid. */ - public Enumeration getAllRevokedPublishedCertificates() + public Enumeration<ICertRecord> getAllRevokedPublishedCertificates() throws EBaseException { IDBSSession s = mDBService.createSession(); - Enumeration e = null; + Enumeration<ICertRecord> e = null; // index is setup for this filter String ldapfilter = "(&(|(" + CertRecord.ATTR_CERT_STATUS + "=" + CertRecord.STATUS_REVOKED + ")(" + CertRecord.ATTR_CERT_STATUS + "=" + CertRecord.STATUS_REVOKED_EXPIRED + "))"; @@ -1746,10 +1746,10 @@ public class CertificateRepository extends Repository /** * Retrieves all revoked certificates that have not expired. */ - public Enumeration getRevokedCertificates(Date asOfDate) + public Enumeration<ICertRecord> getRevokedCertificates(Date asOfDate) throws EBaseException { IDBSSession s = mDBService.createSession(); - Enumeration e = null; + Enumeration<ICertRecord> e = null; try { @@ -1778,10 +1778,10 @@ public class CertificateRepository extends Repository /** * Retrives all revoked certificates excluing ones already expired. */ - public Enumeration getAllRevokedNonExpiredCertificates() + public Enumeration<ICertRecord> getAllRevokedNonExpiredCertificates() throws EBaseException { IDBSSession s = mDBService.createSession(); - Enumeration e = null; + Enumeration<ICertRecord> e = null; String ldapfilter = "(" + CertRecord.ATTR_CERT_STATUS + "=" + CertRecord.STATUS_REVOKED + ")"; // index is setup for this filter try { diff --git a/pki/base/common/src/com/netscape/cmscore/dbs/DateArrayMapper.java b/pki/base/common/src/com/netscape/cmscore/dbs/DateArrayMapper.java index a2dfc9c01..20562404b 100644 --- a/pki/base/common/src/com/netscape/cmscore/dbs/DateArrayMapper.java +++ b/pki/base/common/src/com/netscape/cmscore/dbs/DateArrayMapper.java @@ -39,7 +39,7 @@ import com.netscape.certsrv.dbs.IDBObj; public class DateArrayMapper implements IDBAttrMapper { private String mLdapName = null; - private Vector v = new Vector(); + private Vector<String> v = new Vector<String>(); /** * Constructs a date array mapper. @@ -52,7 +52,7 @@ public class DateArrayMapper implements IDBAttrMapper { /** * Retrieves a list of support ldap attributes. */ - public Enumeration getSupportedLDAPAttributeNames() { + public Enumeration<String> getSupportedLDAPAttributeNames() { return v.elements(); } @@ -84,12 +84,12 @@ public class DateArrayMapper implements IDBAttrMapper { if (attr == null) return; - Enumeration e = attr.getStringValues(); - Vector v = new Vector(); + @SuppressWarnings("unchecked") + Enumeration<String> e = attr.getStringValues(); + Vector<Date> v = new Vector<Date>(); while (e.hasMoreElements()) { - v.addElement(DateMapper.dateFromDB((String) - e.nextElement())); + v.addElement(DateMapper.dateFromDB(e.nextElement())); } if (v.size() == 0) return; diff --git a/pki/base/common/src/com/netscape/cmscore/dbs/DateMapper.java b/pki/base/common/src/com/netscape/cmscore/dbs/DateMapper.java index 58cd1bfee..a767758f6 100644 --- a/pki/base/common/src/com/netscape/cmscore/dbs/DateMapper.java +++ b/pki/base/common/src/com/netscape/cmscore/dbs/DateMapper.java @@ -41,7 +41,7 @@ import com.netscape.certsrv.dbs.IDBObj; public class DateMapper implements IDBAttrMapper { private String mLdapName = null; - private Vector v = new Vector(); + private Vector<String> v = new Vector<String>(); private static SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss'Z'"); @@ -56,7 +56,7 @@ public class DateMapper implements IDBAttrMapper { /** * Retrieves a list of ldap attribute names. */ - public Enumeration getSupportedLDAPAttributeNames() { + public Enumeration<String> getSupportedLDAPAttributeNames() { return v.elements(); } diff --git a/pki/base/common/src/com/netscape/cmscore/dbs/IntegerMapper.java b/pki/base/common/src/com/netscape/cmscore/dbs/IntegerMapper.java index 8d9384927..8dc07e4d9 100644 --- a/pki/base/common/src/com/netscape/cmscore/dbs/IntegerMapper.java +++ b/pki/base/common/src/com/netscape/cmscore/dbs/IntegerMapper.java @@ -38,7 +38,7 @@ import com.netscape.certsrv.dbs.IDBObj; public class IntegerMapper implements IDBAttrMapper { private String mLdapName = null; - private Vector v = new Vector(); + private Vector<String> v = new Vector<String>(); /** * Constructs mapper to deal with Integer. @@ -51,7 +51,7 @@ public class IntegerMapper 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/dbs/KeyRecord.java b/pki/base/common/src/com/netscape/cmscore/dbs/KeyRecord.java index f42377fe2..8f2888715 100644 --- a/pki/base/common/src/com/netscape/cmscore/dbs/KeyRecord.java +++ b/pki/base/common/src/com/netscape/cmscore/dbs/KeyRecord.java @@ -57,7 +57,7 @@ public class KeyRecord implements IDBObj, IKeyRecord { private Date mModifyTime = null; private String mArchivedBy = null; - protected static Vector mNames = new Vector(); + protected static Vector<String> mNames = new Vector<String>(); static { mNames.addElement(ATTR_STATE); mNames.addElement(ATTR_ID); @@ -179,14 +179,14 @@ public class KeyRecord implements IDBObj, IKeyRecord { * Retrieves an enumeration of attributes. * <P> */ - public Enumeration getElements() { + public Enumeration<String> getElements() { return mNames.elements(); } /** * Retrieves serializable attribute names. */ - public Enumeration getSerializableAttrNames() { + public Enumeration<String> getSerializableAttrNames() { return mNames.elements(); } diff --git a/pki/base/common/src/com/netscape/cmscore/dbs/KeyRecordList.java b/pki/base/common/src/com/netscape/cmscore/dbs/KeyRecordList.java index dd0c88a97..34e50c711 100644 --- a/pki/base/common/src/com/netscape/cmscore/dbs/KeyRecordList.java +++ b/pki/base/common/src/com/netscape/cmscore/dbs/KeyRecordList.java @@ -34,12 +34,12 @@ import com.netscape.certsrv.dbs.keydb.IKeyRecordList; */ public class KeyRecordList implements IKeyRecordList { - private IDBVirtualList mVlist = null; + private IDBVirtualList<Object> mVlist = null; /** * Constructs a key list. */ - public KeyRecordList(IDBVirtualList vlist) { + public KeyRecordList(IDBVirtualList<Object> vlist) { mVlist = vlist; } @@ -62,7 +62,7 @@ public class KeyRecordList implements IKeyRecordList { } public IKeyRecord getKeyRecord(int i) { - KeyRecord record = (KeyRecord) mVlist.getElementAt(i); + IKeyRecord record = (IKeyRecord) mVlist.getElementAt(i); if (record == null) return null; @@ -73,12 +73,12 @@ public class KeyRecordList implements IKeyRecordList { /** * Retrieves requests. */ - public Enumeration getKeyRecords(int startidx, int endidx) + public Enumeration<IKeyRecord> getKeyRecords(int startidx, int endidx) throws EBaseException { - Vector entries = new Vector(); + Vector<IKeyRecord> entries = new Vector<IKeyRecord>(); for (int i = startidx; i <= endidx; i++) { - Object element = mVlist.getElementAt(i); + IKeyRecord element = (IKeyRecord) mVlist.getElementAt(i); if (element != null) { entries.addElement(element); diff --git a/pki/base/common/src/com/netscape/cmscore/dbs/KeyRecordMapper.java b/pki/base/common/src/com/netscape/cmscore/dbs/KeyRecordMapper.java index 550cd15e7..1a6103492 100644 --- a/pki/base/common/src/com/netscape/cmscore/dbs/KeyRecordMapper.java +++ b/pki/base/common/src/com/netscape/cmscore/dbs/KeyRecordMapper.java @@ -50,8 +50,8 @@ public class KeyRecordMapper implements IDBAttrMapper { mDB = db; } - public Enumeration getSupportedLDAPAttributeNames() { - Vector v = new Vector(); + public Enumeration<String> getSupportedLDAPAttributeNames() { + Vector<String> v = new Vector<String>(); v.addElement(KeyDBSchema.LDAP_ATTR_KEY_RECORD_ID); return v.elements(); diff --git a/pki/base/common/src/com/netscape/cmscore/dbs/KeyStateMapper.java b/pki/base/common/src/com/netscape/cmscore/dbs/KeyStateMapper.java index dc6aadff1..2622cdbc6 100644 --- a/pki/base/common/src/com/netscape/cmscore/dbs/KeyStateMapper.java +++ b/pki/base/common/src/com/netscape/cmscore/dbs/KeyStateMapper.java @@ -43,8 +43,8 @@ public class KeyStateMapper implements IDBAttrMapper { mLdapName = ldapName; } - public Enumeration getSupportedLDAPAttributeNames() { - Vector v = new Vector(); + public Enumeration<String> getSupportedLDAPAttributeNames() { + Vector<String> v = new Vector<String>(); v.addElement(mLdapName); return v.elements(); diff --git a/pki/base/common/src/com/netscape/cmscore/dbs/LongMapper.java b/pki/base/common/src/com/netscape/cmscore/dbs/LongMapper.java index 2d2d539ed..b4d6c75d6 100644 --- a/pki/base/common/src/com/netscape/cmscore/dbs/LongMapper.java +++ b/pki/base/common/src/com/netscape/cmscore/dbs/LongMapper.java @@ -38,7 +38,7 @@ import com.netscape.certsrv.dbs.IDBObj; public class LongMapper implements IDBAttrMapper { private String mLdapName = null; - private Vector v = new Vector(); + private Vector<String> v = new Vector<String>(); /** * Constructs Long mapper. @@ -51,7 +51,7 @@ public class LongMapper implements IDBAttrMapper { /** * Returns a list of supported ldap attribute names. */ - public Enumeration getSupportedLDAPAttributeNames() { + public Enumeration<String> getSupportedLDAPAttributeNames() { return v.elements(); } diff --git a/pki/base/common/src/com/netscape/cmscore/dbs/MetaInfoMapper.java b/pki/base/common/src/com/netscape/cmscore/dbs/MetaInfoMapper.java index f175c811a..9b224508c 100644 --- a/pki/base/common/src/com/netscape/cmscore/dbs/MetaInfoMapper.java +++ b/pki/base/common/src/com/netscape/cmscore/dbs/MetaInfoMapper.java @@ -48,7 +48,7 @@ public class MetaInfoMapper implements IDBAttrMapper { public static final String SEP = ":"; private String mLdapName = null; - private Vector v = new Vector(); + private Vector<String> v = new Vector<String>(); /** * Constructs a metainfo object. @@ -61,7 +61,7 @@ public class MetaInfoMapper implements IDBAttrMapper { /** * Returns a list of supported ldap attribute names. */ - public Enumeration getSupportedLDAPAttributeNames() { + public Enumeration<String> getSupportedLDAPAttributeNames() { return v.elements(); } @@ -72,7 +72,7 @@ public class MetaInfoMapper implements IDBAttrMapper { String name, Object obj, LDAPAttributeSet attrs) throws EBaseException { MetaInfo info = (MetaInfo) obj; - Enumeration e = info.getElements(); + Enumeration<String> e = info.getElements(); if (!e.hasMoreElements()) return; // dont add anything @@ -80,7 +80,7 @@ public class MetaInfoMapper implements IDBAttrMapper { while (e.hasMoreElements()) { String s = null; - String attrName = (String) e.nextElement(); + String attrName = e.nextElement(); String value = (String) info.get(attrName); s = attrName + SEP + value; @@ -99,11 +99,12 @@ public class MetaInfoMapper implements IDBAttrMapper { if (attr == null) return; - Enumeration values = attr.getStringValues(); + @SuppressWarnings("unchecked") + Enumeration<String> values = attr.getStringValues(); MetaInfo info = new MetaInfo(); while (values.hasMoreElements()) { - String s = (String) values.nextElement(); + String s = values.nextElement(); StringTokenizer st = new StringTokenizer(s, SEP); info.set(st.nextToken(), st.nextToken()); |