diff options
Diffstat (limited to 'pki')
177 files changed, 338 insertions, 738 deletions
diff --git a/pki/base/ca/src/com/netscape/ca/CAService.java b/pki/base/ca/src/com/netscape/ca/CAService.java index 88c9dfb8d..62bae3b5f 100644 --- a/pki/base/ca/src/com/netscape/ca/CAService.java +++ b/pki/base/ca/src/com/netscape/ca/CAService.java @@ -837,7 +837,6 @@ public class CAService implements ICAService, IService { try { CMS.debug("doUTF8 true, updating subject."); - CertificateSubjectName sName = (CertificateSubjectName) certi.get(X509CertInfo.SUBJECT); String subject = certi.get(X509CertInfo.SUBJECT).toString(); @@ -987,20 +986,7 @@ public class CAService implements ICAService, IService { CMS.getUserMessage("CMS_CA_CANT_FIND_CERT_SERIAL", "0x" + serialno.toString(16))); } - RevocationInfo revInfo = (RevocationInfo) certRec.getRevocationInfo(); - CRLExtensions exts = null; - CRLReasonExtension reasonext = null; - if (revInfo != null) - exts = revInfo.getCRLEntryExtensions(); - if (exts != null) { - try { - reasonext = (CRLReasonExtension) - exts.get(CRLReasonExtension.NAME); - } catch (X509ExtensionException e) { - // this means no crl reason extension set. - } - } // allow revoking certs that are on hold. String certStatus = certRec.getStatus(); diff --git a/pki/base/ca/src/com/netscape/ca/CRLIssuingPoint.java b/pki/base/ca/src/com/netscape/ca/CRLIssuingPoint.java index dd6194101..d4b747b32 100644 --- a/pki/base/ca/src/com/netscape/ca/CRLIssuingPoint.java +++ b/pki/base/ca/src/com/netscape/ca/CRLIssuingPoint.java @@ -3029,7 +3029,6 @@ class CertRecProcessor implements IElementProcessor { onlySomeReasons = issuingDistributionPoint.getOnlySomeReasons(); boolean applyReasonMatch = false; - boolean reasonMatch = true; if (onlySomeReasons != null) { applyReasonMatch = !onlySomeReasons.toString().equals("0000000"); diff --git a/pki/base/ca/src/com/netscape/ca/CertificateAuthority.java b/pki/base/ca/src/com/netscape/ca/CertificateAuthority.java index 00fcbae0f..007ebf207 100644 --- a/pki/base/ca/src/com/netscape/ca/CertificateAuthority.java +++ b/pki/base/ca/src/com/netscape/ca/CertificateAuthority.java @@ -931,7 +931,6 @@ public class CertificateAuthority implements ICertificateAuthority, ICertAuthori statsSub.startTiming("signing"); } - long startTime = CMS.getCurrentDate().getTime(); try { DerOutputStream out = new DerOutputStream(); DerOutputStream tmp = new DerOutputStream(); @@ -1006,7 +1005,6 @@ public class CertificateAuthority implements ICertificateAuthority, ICertAuthori statsSub.startTiming("signing"); } - long startTime = CMS.getCurrentDate().getTime(); try { DerOutputStream out = new DerOutputStream(); DerOutputStream tmp = new DerOutputStream(); @@ -1328,7 +1326,7 @@ public class CertificateAuthority implements ICertificateAuthority, ICertAuthori Long l = Long.valueOf(file.length()); byte[] b = new byte[l.intValue()]; FileInputStream in = new FileInputStream(path); - int num = in.read(b); + in.read(b); in.close(); return b; @@ -1589,8 +1587,6 @@ public class CertificateAuthority implements ICertificateAuthority, ICertAuthori } // Initialize Request In Queue notification listener - IConfigStore rq = nc.getSubStore(PROP_REQ_IN_Q_SUBSTORE); - String requestInQListenerClassName = nc.getString("certificateIssuedListenerClassName", "com.netscape.cms.listeners.RequestInQListener"); @@ -1603,9 +1599,6 @@ public class CertificateAuthority implements ICertificateAuthority, ICertAuthori CMS.getLogMessage("CMSCORE_CA_CA_REGISTER_REQ_LISTENER", requestInQListenerClassName)); } - // Initialize extra listeners - IConfigStore mListenerConfig = null; - } else { log(ILogger.LL_FAILURE, CMS.getLogMessage("CMSCORE_CA_CA_NOTIFY_NONE")); } @@ -1703,7 +1696,6 @@ public class CertificateAuthority implements ICertificateAuthority, ICertAuthori "initializing crl issue point " + issuePointId); IConfigStore issuePointConfig = null; String issuePointClassName = null; - @SuppressWarnings("unchecked") Class<CRLIssuingPoint> issuePointClass = null; CRLIssuingPoint issuePoint = null; diff --git a/pki/base/common/src/com/netscape/certsrv/base/IPluginImpl.java b/pki/base/common/src/com/netscape/certsrv/base/IPluginImpl.java index 566fef38f..a7a0560b5 100644 --- a/pki/base/common/src/com/netscape/certsrv/base/IPluginImpl.java +++ b/pki/base/common/src/com/netscape/certsrv/base/IPluginImpl.java @@ -84,7 +84,7 @@ public interface IPluginImpl { * @return nvPairs A Vector of name/value pairs. Each name/value * pair is constructed as a String in name=value format. */ - public Vector getInstanceParams(); + public Vector<String> getInstanceParams(); /** * Retrieves a list of configuration parameter names. @@ -99,6 +99,6 @@ public interface IPluginImpl { * @return nvPairs A Vector of name/value pairs. Each name/value * pair is constructed as a String in name=value. */ - public Vector getDefaultParams(); + public Vector<String> getDefaultParams(); } diff --git a/pki/base/common/src/com/netscape/certsrv/publish/ILdapCertMapper.java b/pki/base/common/src/com/netscape/certsrv/publish/ILdapCertMapper.java index 7e2e1116c..3acaeb580 100644 --- a/pki/base/common/src/com/netscape/certsrv/publish/ILdapCertMapper.java +++ b/pki/base/common/src/com/netscape/certsrv/publish/ILdapCertMapper.java @@ -44,12 +44,12 @@ public interface ILdapCertMapper extends ILdapPlugin { /** * Returns the default parameters. */ - public Vector getDefaultParams(); + public Vector<String> getDefaultParams(); /** * Returns the instance parameters. */ - public Vector getInstanceParams(); + public Vector<String> getInstanceParams(); /** * maps a certificate to a LDAP entry. diff --git a/pki/base/common/src/com/netscape/certsrv/request/AgentApprovals.java b/pki/base/common/src/com/netscape/certsrv/request/AgentApprovals.java index 54277b611..d6fa41b8f 100644 --- a/pki/base/common/src/com/netscape/certsrv/request/AgentApprovals.java +++ b/pki/base/common/src/com/netscape/certsrv/request/AgentApprovals.java @@ -127,14 +127,14 @@ public class AgentApprovals * @param stringVector The vector of strings to translate * @return the AgentApprovals instance or null if it can't be translated. */ - public static AgentApprovals fromStringVector(Vector stringVector) { + public static AgentApprovals fromStringVector(Vector<String> stringVector) { if (stringVector == null) { return null; } AgentApprovals approvals = new AgentApprovals(); for (int i = 0; i < stringVector.size(); i++) { try { - String approvalString = (String) stringVector.get(i); + String approvalString = stringVector.get(i); String[] parts = approvalString.split(";", 2); if (parts.length != 2) { return null; diff --git a/pki/base/common/src/com/netscape/certsrv/template/ArgList.java b/pki/base/common/src/com/netscape/certsrv/template/ArgList.java index aa0be2d55..586bf7663 100644 --- a/pki/base/common/src/com/netscape/certsrv/template/ArgList.java +++ b/pki/base/common/src/com/netscape/certsrv/template/ArgList.java @@ -29,7 +29,7 @@ import java.util.Vector; */ public class ArgList implements IArgValue { - private Vector mList = new Vector(); + private Vector<IArgValue> mList = new Vector<IArgValue>(); /** * Constructs a argument list object. diff --git a/pki/base/common/src/com/netscape/certsrv/util/HttpInput.java b/pki/base/common/src/com/netscape/certsrv/util/HttpInput.java index ba5bfdb08..7e7fe7c4a 100644 --- a/pki/base/common/src/com/netscape/certsrv/util/HttpInput.java +++ b/pki/base/common/src/com/netscape/certsrv/util/HttpInput.java @@ -109,7 +109,7 @@ public class HttpInput { throws IOException { String v = getString(request, name); try { - URL u = new URL(v); + new URL(v); // throw exception on error } catch (Exception e) { throw new IOException("Invalid URL " + v); } diff --git a/pki/base/common/src/com/netscape/cms/authentication/CMCAuth.java b/pki/base/common/src/com/netscape/cms/authentication/CMCAuth.java index 905efc42a..06d4eaa0f 100644 --- a/pki/base/common/src/com/netscape/cms/authentication/CMCAuth.java +++ b/pki/base/common/src/com/netscape/cms/authentication/CMCAuth.java @@ -150,13 +150,13 @@ public class CMCAuth implements IAuthManager, IExtendedPluginInfo, //////////////////////////////////// /* Vector of extendedPluginInfo strings */ - protected static Vector mExtendedPluginInfo = null; + protected static Vector<String> mExtendedPluginInfo = null; //public static final String AGENT_AUTHMGR_ID = "agentAuthMgr"; //public static final String AGENT_PLUGIN_ID = "agentAuthPlugin"; /* actual help messages */ static { - mExtendedPluginInfo = new Vector(); + mExtendedPluginInfo = new Vector<String>(); mExtendedPluginInfo .add(IExtendedPluginInfo.HELP_TEXT + diff --git a/pki/base/common/src/com/netscape/cms/authentication/DNPattern.java b/pki/base/common/src/com/netscape/cms/authentication/DNPattern.java index 653a950aa..480b5b909 100644 --- a/pki/base/common/src/com/netscape/cms/authentication/DNPattern.java +++ b/pki/base/common/src/com/netscape/cms/authentication/DNPattern.java @@ -153,7 +153,7 @@ public class DNPattern { private void parse(PushbackReader in) throws EAuthException { - Vector rdnPatterns = new Vector(); + Vector<RDNPattern> rdnPatterns = new Vector<RDNPattern>(); RDNPattern rdnPattern = null; int lastChar = -1; @@ -170,7 +170,7 @@ public class DNPattern { mRDNPatterns = new RDNPattern[rdnPatterns.size()]; rdnPatterns.copyInto(mRDNPatterns); - Vector ldapAttrs = new Vector(); + Vector<String> ldapAttrs = new Vector<String>(); for (int i = 0; i < mRDNPatterns.length; i++) { String[] rdnAttrs = mRDNPatterns[i].getLdapAttrs(); diff --git a/pki/base/common/src/com/netscape/cms/authentication/PortalEnroll.java b/pki/base/common/src/com/netscape/cms/authentication/PortalEnroll.java index fe2c352ec..38a3e6fcf 100644 --- a/pki/base/common/src/com/netscape/cms/authentication/PortalEnroll.java +++ b/pki/base/common/src/com/netscape/cms/authentication/PortalEnroll.java @@ -83,14 +83,14 @@ public class PortalEnroll extends DirBasedAuthentication { // contains all nested superiors' required attrs in the form of a // vector of "required" attributes in Enumeration - Vector mRequiredAttrs = null; + Vector<Enumeration<String>> mRequiredAttrs = null; // contains all nested superiors' optional attrs in the form of a // vector of "optional" attributes in Enumeration - Vector mOptionalAttrs = null; + Vector<Enumeration<String>> mOptionalAttrs = null; // contains all the objclasses, including superiors and itself - Vector mObjClasses = null; + Vector<String> mObjClasses = null; /* Holds configuration parameters accepted by this implementation. * This list is passed to the configuration console so configuration @@ -324,15 +324,15 @@ public class PortalEnroll extends DirBasedAuthentication { String dn = "uid=" + uid + "," + mBaseDN; /* Specify the attributes of the entry */ - Vector objectclass_values = null; + Vector<String> objectclass_values = null; LDAPAttributeSet attrs = new LDAPAttributeSet(); LDAPAttribute attr = new LDAPAttribute("objectclass"); // initialized to new - mRequiredAttrs = new Vector(); - mOptionalAttrs = new Vector(); - mObjClasses = new Vector(); + mRequiredAttrs = new Vector<Enumeration<String>>(); + mOptionalAttrs = new Vector<Enumeration<String>>(); + mObjClasses = new Vector<String>(); LDAPSchema dirSchema = null; @@ -431,6 +431,7 @@ public class PortalEnroll extends DirBasedAuthentication { * should build up * mRequiredAttrs, mOptionalAttrs, and mObjClasses when returned */ + @SuppressWarnings("unchecked") public void initLdapAttrs(LDAPSchema dirSchema, String oclass) { CMS.debug("PortalEnroll: in initLdapAttrsAttrs"); mObjClasses.addElement(oclass); diff --git a/pki/base/common/src/com/netscape/cms/authentication/RDNPattern.java b/pki/base/common/src/com/netscape/cms/authentication/RDNPattern.java index 02a8f1438..722aefbc3 100644 --- a/pki/base/common/src/com/netscape/cms/authentication/RDNPattern.java +++ b/pki/base/common/src/com/netscape/cms/authentication/RDNPattern.java @@ -158,7 +158,7 @@ class RDNPattern { private void parse(PushbackReader in) throws EAuthException { //System.out.println("_________ begin rdn _________"); - Vector avaPatterns = new Vector(); + Vector<AVAPattern> avaPatterns = new Vector<AVAPattern>(); AVAPattern avaPattern = null; int lastChar; @@ -188,7 +188,7 @@ class RDNPattern { mAVAPatterns = new AVAPattern[avaPatterns.size()]; avaPatterns.copyInto(mAVAPatterns); - Vector ldapAttrs = new Vector(); + Vector<String> ldapAttrs = new Vector<String>(); for (int i = 0; i < mAVAPatterns.length; i++) { String avaAttr = mAVAPatterns[i].getLdapAttr(); diff --git a/pki/base/common/src/com/netscape/cms/authorization/AAclAuthz.java b/pki/base/common/src/com/netscape/cms/authorization/AAclAuthz.java index 73995e6cd..570fe3a88 100644 --- a/pki/base/common/src/com/netscape/cms/authorization/AAclAuthz.java +++ b/pki/base/common/src/com/netscape/cms/authorization/AAclAuthz.java @@ -656,7 +656,6 @@ public abstract class AAclAuthz { } public Vector<String> getNodes(String resourceID) { - Enumeration<String> parents = getTargetNames(); Vector<String> v = new Vector<String>(); if (resourceID != null && !resourceID.equals("")) { diff --git a/pki/base/common/src/com/netscape/cms/jobs/PublishCertsJob.java b/pki/base/common/src/com/netscape/cms/jobs/PublishCertsJob.java index 2289d7255..28268dfab 100644 --- a/pki/base/common/src/com/netscape/cms/jobs/PublishCertsJob.java +++ b/pki/base/common/src/com/netscape/cms/jobs/PublishCertsJob.java @@ -21,7 +21,6 @@ import java.text.DateFormat; import java.util.Date; import java.util.Enumeration; import java.util.Locale; -import java.util.Vector; import netscape.security.x509.X509CertImpl; @@ -86,12 +85,6 @@ public class PublishCertsJob extends AJobBase "summary.recipientEmail" }; - /* Vector of extendedPluginInfo strings */ - protected static Vector mExtendedPluginInfo = null; - static { - mExtendedPluginInfo = new Vector(); - }; - public String[] getExtendedPluginInfo(Locale locale) { String s[] = { IExtendedPluginInfo.HELP_TEXT + @@ -217,7 +210,6 @@ public class PublishCertsJob extends AJobBase if (rec == null) break; X509CertImpl cert = rec.getCertificate(); - Date notBefore = cert.getNotBefore(); Date notAfter = cert.getNotAfter(); // skip CA certs diff --git a/pki/base/common/src/com/netscape/cms/jobs/RenewalNotificationJob.java b/pki/base/common/src/com/netscape/cms/jobs/RenewalNotificationJob.java index 5a14c6278..5ca581445 100644 --- a/pki/base/common/src/com/netscape/cms/jobs/RenewalNotificationJob.java +++ b/pki/base/common/src/com/netscape/cms/jobs/RenewalNotificationJob.java @@ -23,7 +23,6 @@ import java.util.Date; import java.util.Enumeration; import java.util.Locale; import java.util.StringTokenizer; -import java.util.Vector; import com.netscape.certsrv.apps.CMS; import com.netscape.certsrv.base.EBaseException; @@ -195,13 +194,6 @@ public class RenewalNotificationJob private int mMaxNotifyCount = 1; private String[] mProfileId = null; - /* Vector of extendedPluginInfo strings */ - protected static Vector mExtendedPluginInfo = null; - - static { - mExtendedPluginInfo = new Vector(); - }; - /** * class constructor */ diff --git a/pki/base/common/src/com/netscape/cms/jobs/RequestInQueueJob.java b/pki/base/common/src/com/netscape/cms/jobs/RequestInQueueJob.java index 775845ca7..b04461941 100644 --- a/pki/base/common/src/com/netscape/cms/jobs/RequestInQueueJob.java +++ b/pki/base/common/src/com/netscape/cms/jobs/RequestInQueueJob.java @@ -33,7 +33,6 @@ import com.netscape.certsrv.jobs.IJobsScheduler; import com.netscape.certsrv.notification.IEmailFormProcessor; import com.netscape.certsrv.request.IRequestList; import com.netscape.certsrv.request.IRequestQueue; -import com.netscape.certsrv.request.RequestId; import com.netscape.certsrv.request.RequestStatus; /** @@ -171,7 +170,7 @@ public class RequestInQueueJob extends AJobBase mReqQ.listRequestsByStatus(RequestStatus.PENDING); while (list != null && list.hasMoreElements()) { - RequestId rid = list.nextRequestId(); + list.nextRequestId(); /* This is way too slow // get request from request id diff --git a/pki/base/common/src/com/netscape/cms/jobs/UnpublishExpiredJob.java b/pki/base/common/src/com/netscape/cms/jobs/UnpublishExpiredJob.java index 63cae7f30..2f4a6ad75 100644 --- a/pki/base/common/src/com/netscape/cms/jobs/UnpublishExpiredJob.java +++ b/pki/base/common/src/com/netscape/cms/jobs/UnpublishExpiredJob.java @@ -22,7 +22,6 @@ import java.text.DateFormat; import java.util.Date; import java.util.Enumeration; import java.util.Locale; -import java.util.Vector; import netscape.security.x509.X509CertImpl; @@ -87,12 +86,6 @@ public class UnpublishExpiredJob extends AJobBase "summary.recipientEmail" }; - /* Vector of extendedPluginInfo strings */ - protected static Vector mExtendedPluginInfo = null; - static { - mExtendedPluginInfo = new Vector(); - }; - public String[] getExtendedPluginInfo(Locale locale) { String s[] = { IExtendedPluginInfo.HELP_TEXT + diff --git a/pki/base/common/src/com/netscape/cms/logging/LogEntry.java b/pki/base/common/src/com/netscape/cms/logging/LogEntry.java index 759b09379..d91bd7406 100644 --- a/pki/base/common/src/com/netscape/cms/logging/LogEntry.java +++ b/pki/base/common/src/com/netscape/cms/logging/LogEntry.java @@ -35,7 +35,7 @@ public class LogEntry { private String mDetail; private String mDate; private String mTime; - private Vector mRow; + private Vector<String> mRow; private final String DATE_PATTERN = "dd/MMM/yyyy:HH:mm:ss z"; @@ -54,7 +54,7 @@ public class LogEntry { * return a vector of the segments of the entry */ - public Vector parse() throws ParseException { + public Vector<String> parse() throws ParseException { int x = mEntry.indexOf("["); if (x == -1) @@ -86,7 +86,7 @@ public class LogEntry { mDetail = temp.substring(x + 2); - Vector row = new Vector(); + Vector<String> row = new Vector<String>(); row.addElement(mSource); row.addElement(mLevel); @@ -119,7 +119,7 @@ public class LogEntry { return mTime; } - public Vector getRow() { + public Vector<String> getRow() { return mRow; } diff --git a/pki/base/common/src/com/netscape/cms/ocsp/DefStore.java b/pki/base/common/src/com/netscape/cms/ocsp/DefStore.java index 2482d69af..21f7023d8 100644 --- a/pki/base/common/src/com/netscape/cms/ocsp/DefStore.java +++ b/pki/base/common/src/com/netscape/cms/ocsp/DefStore.java @@ -45,7 +45,6 @@ import com.netscape.certsrv.base.IExtendedPluginInfo; import com.netscape.certsrv.base.ISubsystem; import com.netscape.certsrv.common.Constants; import com.netscape.certsrv.common.NameValuePairs; -import com.netscape.certsrv.dbs.IDBRegistry; import com.netscape.certsrv.dbs.IDBSSession; import com.netscape.certsrv.dbs.IDBSearchResults; import com.netscape.certsrv.dbs.IDBSubsystem; @@ -161,9 +160,6 @@ public class DefStore implements IDefStore, IExtendedPluginInfo { mIncludeNextUpdate = mConfig.getBoolean(PROP_INCLUDE_NEXT_UPDATE, false); - // should move this into DBSubsystem .... - IDBRegistry reg = mDBService.getRegistry(); - // init web gateway. initWebGateway(); diff --git a/pki/base/common/src/com/netscape/cms/ocsp/LDAPStore.java b/pki/base/common/src/com/netscape/cms/ocsp/LDAPStore.java index ac6534afd..bca02f4a6 100644 --- a/pki/base/common/src/com/netscape/cms/ocsp/LDAPStore.java +++ b/pki/base/common/src/com/netscape/cms/ocsp/LDAPStore.java @@ -696,10 +696,6 @@ class TempCRLIssuingPointRecord implements ICRLIssuingPointRecord { return null; } - public Vector getSplitTimes() { - return null; - } - public int isCRLIssuingPointInitialized() { return 1; } diff --git a/pki/base/common/src/com/netscape/cms/policy/APolicyRule.java b/pki/base/common/src/com/netscape/cms/policy/APolicyRule.java index 1c43d92d4..0faf7591d 100644 --- a/pki/base/common/src/com/netscape/cms/policy/APolicyRule.java +++ b/pki/base/common/src/com/netscape/cms/policy/APolicyRule.java @@ -148,14 +148,14 @@ public abstract class APolicyRule implements IPolicyRule { * * @return nvPairs A Vector of name/value pairs. */ - public abstract Vector getInstanceParams(); + public abstract Vector<String> getInstanceParams(); /** * Return default parameters for a policy implementation. * * @return nvPairs A Vector of name/value pairs. */ - public abstract Vector getDefaultParams(); + public abstract Vector<String> getDefaultParams(); public void setError(IRequest req, String format, Object[] params) { setPolicyException(req, format, params); @@ -178,9 +178,9 @@ public abstract class APolicyRule implements IPolicyRule { } public void setPolicyException(IRequest req, EBaseException ex) { - Vector ev = req.getExtDataInStringVector(IRequest.ERRORS); + Vector<String> ev = req.getExtDataInStringVector(IRequest.ERRORS); if (ev == null) { - ev = new Vector(); + ev = new Vector<String>(); } ev.addElement(ex.toString()); req.setExtData(IRequest.ERRORS, ev); @@ -235,9 +235,9 @@ public abstract class APolicyRule implements IPolicyRule { else ex = new EPolicyException(format, params); - Vector ev = req.getExtDataInStringVector(IRequest.ERRORS); + Vector<String> ev = req.getExtDataInStringVector(IRequest.ERRORS); if (ev == null) { - ev = new Vector(); + ev = new Vector<String>(); } ev.addElement(ex.toString()); req.setExtData(IRequest.ERRORS, ev); diff --git a/pki/base/common/src/com/netscape/cms/policy/constraints/DSAKeyConstraints.java b/pki/base/common/src/com/netscape/cms/policy/constraints/DSAKeyConstraints.java index 9ad322085..387b702bf 100644 --- a/pki/base/common/src/com/netscape/cms/policy/constraints/DSAKeyConstraints.java +++ b/pki/base/common/src/com/netscape/cms/policy/constraints/DSAKeyConstraints.java @@ -64,7 +64,7 @@ public class DSAKeyConstraints extends APolicyRule private final static String PROP_MIN_SIZE = "minSize"; private final static String PROP_MAX_SIZE = "maxSize"; - private final static Vector defConfParams = new Vector(); + private final static Vector<String> defConfParams = new Vector<String>(); private IConfigStore mConfig = null; @@ -193,9 +193,6 @@ public class DSAKeyConstraints extends APolicyRule if (keyParams == null) { // key parameters could not be parsed. - Object[] params = new Object[] { - getInstanceName(), String.valueOf(i + 1) }; - setError(req, CMS.getUserMessage("CMS_POLICY_NO_KEY_PARAMS", getInstanceName(), String.valueOf(i + 1)), ""); @@ -232,8 +229,8 @@ public class DSAKeyConstraints extends APolicyRule * * @return nvPairs A Vector of name/value pairs. */ - public Vector getInstanceParams() { - Vector confParams = new Vector(); + public Vector<String> getInstanceParams() { + Vector<String> confParams = new Vector<String>(); try { confParams.addElement(PROP_MIN_SIZE + "=" + mConfig.getInteger(PROP_MIN_SIZE, DEF_MIN_SIZE)); @@ -249,7 +246,7 @@ public class DSAKeyConstraints extends APolicyRule * * @return nvPairs A Vector of name/value pairs. */ - public Vector getDefaultParams() { + public Vector<String> getDefaultParams() { return defConfParams; } } diff --git a/pki/base/common/src/com/netscape/cms/policy/constraints/DefaultRevocation.java b/pki/base/common/src/com/netscape/cms/policy/constraints/DefaultRevocation.java index f341dd224..2af145475 100644 --- a/pki/base/common/src/com/netscape/cms/policy/constraints/DefaultRevocation.java +++ b/pki/base/common/src/com/netscape/cms/policy/constraints/DefaultRevocation.java @@ -81,7 +81,7 @@ public class DefaultRevocation extends APolicyRule * * @return nvPairs A Vector of name/value pairs. */ - public Vector getInstanceParams() { + public Vector<String> getInstanceParams() { return null; } @@ -90,7 +90,7 @@ public class DefaultRevocation extends APolicyRule * * @return nvPairs A Vector of name/value pairs. */ - public Vector getDefaultParams() { + public Vector<String> getDefaultParams() { return null; } diff --git a/pki/base/common/src/com/netscape/cms/policy/constraints/IssuerConstraints.java b/pki/base/common/src/com/netscape/cms/policy/constraints/IssuerConstraints.java index b0e27501e..a08bde78c 100644 --- a/pki/base/common/src/com/netscape/cms/policy/constraints/IssuerConstraints.java +++ b/pki/base/common/src/com/netscape/cms/policy/constraints/IssuerConstraints.java @@ -193,8 +193,8 @@ public class IssuerConstraints extends APolicyRule * * @return nvPairs A Vector of name/value pairs. */ - public Vector getInstanceParams() { - Vector confParams = new Vector(); + public Vector<String> getInstanceParams() { + Vector<String> confParams = new Vector<String>(); confParams.addElement(PROP_ISSUER_DN + "=" + mIssuerDNString); @@ -206,8 +206,8 @@ public class IssuerConstraints extends APolicyRule * * @return nvPairs A Vector of name/value pairs. */ - public Vector getDefaultParams() { - Vector defParams = new Vector(); + public Vector<String> getDefaultParams() { + Vector<String> defParams = new Vector<String>(); defParams.addElement(PROP_ISSUER_DN + "="); return defParams; diff --git a/pki/base/common/src/com/netscape/cms/policy/constraints/KeyAlgorithmConstraints.java b/pki/base/common/src/com/netscape/cms/policy/constraints/KeyAlgorithmConstraints.java index 9bb806eba..3779b16e3 100644 --- a/pki/base/common/src/com/netscape/cms/policy/constraints/KeyAlgorithmConstraints.java +++ b/pki/base/common/src/com/netscape/cms/policy/constraints/KeyAlgorithmConstraints.java @@ -58,7 +58,7 @@ public class KeyAlgorithmConstraints extends APolicyRule private final static String[] supportedAlgorithms = { "RSA", "DSA", "DH" }; - private final static Vector defConfParams = new Vector(); + private final static Vector<String> defConfParams = new Vector<String>(); static { defConfParams.addElement(PROP_ALGORITHMS + "=" + @@ -219,7 +219,7 @@ public class KeyAlgorithmConstraints extends APolicyRule * * @return nvPairs A Vector of name/value pairs. */ - public Vector getDefaultParams() { + public Vector<String> getDefaultParams() { return defConfParams; } } diff --git a/pki/base/common/src/com/netscape/cms/policy/constraints/ManualAuthentication.java b/pki/base/common/src/com/netscape/cms/policy/constraints/ManualAuthentication.java index b93487609..3af9e636f 100644 --- a/pki/base/common/src/com/netscape/cms/policy/constraints/ManualAuthentication.java +++ b/pki/base/common/src/com/netscape/cms/policy/constraints/ManualAuthentication.java @@ -86,7 +86,7 @@ public class ManualAuthentication extends APolicyRule * * @return nvPairs A Vector of name/value pairs. */ - public Vector getInstanceParams() { + public Vector<String> getInstanceParams() { return null; } @@ -95,7 +95,7 @@ public class ManualAuthentication extends APolicyRule * * @return nvPairs A Vector of name/value pairs. */ - public Vector getDefaultParams() { + public Vector<String> getDefaultParams() { return null; } } diff --git a/pki/base/common/src/com/netscape/cms/policy/constraints/RenewalConstraints.java b/pki/base/common/src/com/netscape/cms/policy/constraints/RenewalConstraints.java index 185bceed9..f3e5efc9b 100644 --- a/pki/base/common/src/com/netscape/cms/policy/constraints/RenewalConstraints.java +++ b/pki/base/common/src/com/netscape/cms/policy/constraints/RenewalConstraints.java @@ -62,7 +62,7 @@ public class RenewalConstraints extends APolicyRule public final static int DEF_RENEWAL_NOT_AFTER = 30; public final static long DAYS_TO_MS_FACTOR = 24L * 3600 * 1000; - private final static Vector defConfParams = new Vector(); + private final static Vector<String> defConfParams = new Vector<String>(); static { defConfParams.addElement(PROP_ALLOW_EXPIRED_CERTS + "=" + true); defConfParams.addElement(PROP_RENEWAL_NOT_AFTER + "=" + @@ -221,8 +221,8 @@ public class RenewalConstraints extends APolicyRule * * @return nvPairs A Vector of name/value pairs. */ - public Vector getInstanceParams() { - Vector confParams = new Vector(); + public Vector<String> getInstanceParams() { + Vector<String> confParams = new Vector<String>(); confParams.addElement( PROP_ALLOW_EXPIRED_CERTS + "=" + mAllowExpiredCerts); @@ -236,7 +236,7 @@ public class RenewalConstraints extends APolicyRule * * @return nvPairs A Vector of name/value pairs. */ - public Vector getDefaultParams() { + public Vector<String> getDefaultParams() { return defConfParams; } } diff --git a/pki/base/common/src/com/netscape/cms/policy/constraints/RenewalValidityConstraints.java b/pki/base/common/src/com/netscape/cms/policy/constraints/RenewalValidityConstraints.java index 023605db4..0265ff855 100644 --- a/pki/base/common/src/com/netscape/cms/policy/constraints/RenewalValidityConstraints.java +++ b/pki/base/common/src/com/netscape/cms/policy/constraints/RenewalValidityConstraints.java @@ -74,7 +74,7 @@ public class RenewalValidityConstraints extends APolicyRule public static final String CERT_HEADER = "-----BEGIN CERTIFICATE-----\n"; public static final String CERT_TRAILER = "-----END CERTIFICATE-----\n"; - private final static Vector defConfParams = new Vector(); + private final static Vector<String> defConfParams = new Vector<String>(); static { defConfParams.addElement(PROP_MIN_VALIDITY + "=" + @@ -281,8 +281,8 @@ public class RenewalValidityConstraints extends APolicyRule * * @return nvPairs A Vector of name/value pairs. */ - public Vector getInstanceParams() { - Vector confParams = new Vector(); + public Vector<String> getInstanceParams() { + Vector<String> confParams = new Vector<String>(); confParams.addElement(PROP_MIN_VALIDITY + "=" + mMinValidity / DAYS_TO_MS_FACTOR); @@ -298,7 +298,7 @@ public class RenewalValidityConstraints extends APolicyRule * * @return nvPairs A Vector of name/value pairs. */ - public Vector getDefaultParams() { + public Vector<String> getDefaultParams() { return defConfParams; } diff --git a/pki/base/common/src/com/netscape/cms/policy/constraints/RevocationConstraints.java b/pki/base/common/src/com/netscape/cms/policy/constraints/RevocationConstraints.java index d4859195d..513e199c4 100644 --- a/pki/base/common/src/com/netscape/cms/policy/constraints/RevocationConstraints.java +++ b/pki/base/common/src/com/netscape/cms/policy/constraints/RevocationConstraints.java @@ -57,7 +57,7 @@ public class RevocationConstraints extends APolicyRule private boolean mAllowExpiredCerts = true; private boolean mAllowOnHold = true; - private final static Vector defConfParams = new Vector(); + private final static Vector<String> defConfParams = new Vector<String>(); static { defConfParams.addElement(PROP_ALLOW_EXPIRED_CERTS + "=" + true); defConfParams.addElement(PROP_ALLOW_ON_HOLD + "=" + true); @@ -194,8 +194,8 @@ public class RevocationConstraints extends APolicyRule * * @return nvPairs A Vector of name/value pairs. */ - public Vector getInstanceParams() { - Vector confParams = new Vector(); + public Vector<String> getInstanceParams() { + Vector<String> confParams = new Vector<String>(); confParams.addElement( PROP_ALLOW_EXPIRED_CERTS + "=" + mAllowExpiredCerts); @@ -209,7 +209,7 @@ public class RevocationConstraints extends APolicyRule * * @return nvPairs A Vector of name/value pairs. */ - public Vector getDefaultParams() { + public Vector<String> getDefaultParams() { return defConfParams; } } diff --git a/pki/base/common/src/com/netscape/cms/policy/constraints/SigningAlgorithmConstraints.java b/pki/base/common/src/com/netscape/cms/policy/constraints/SigningAlgorithmConstraints.java index 8c2ba0796..8b504eb50 100644 --- a/pki/base/common/src/com/netscape/cms/policy/constraints/SigningAlgorithmConstraints.java +++ b/pki/base/common/src/com/netscape/cms/policy/constraints/SigningAlgorithmConstraints.java @@ -62,7 +62,7 @@ public class SigningAlgorithmConstraints extends APolicyRule IAuthority mAuthority = null; private final static String PROP_ALGORITHMS = "algorithms"; - private final static Vector defConfParams = new Vector(); + private final static Vector<String> defConfParams = new Vector<String>(); static { StringBuffer sb = new StringBuffer(); @@ -120,7 +120,7 @@ public class SigningAlgorithmConstraints extends APolicyRule if (algNames != null) { // parse alg names into Vector StringTokenizer tok = new StringTokenizer(algNames, ","); - Vector algs = new Vector(); + Vector<String> algs = new Vector<String>(); while (tok.hasMoreTokens()) { algs.addElement(tok.nextToken().trim()); @@ -211,7 +211,7 @@ public class SigningAlgorithmConstraints extends APolicyRule int i, j, goodSize; // validate the currently-allowed algorithms - Vector goodAlgs = new Vector(); + Vector<String> goodAlgs = new Vector<String>(); for (i = 0; i < mAllowedAlgs.length; i++) { for (j = 0; j < allowed.length; j++) { @@ -324,8 +324,8 @@ public class SigningAlgorithmConstraints extends APolicyRule * * @return nvPairs A Vector of name/value pairs. */ - public Vector getInstanceParams() { - Vector confParams = new Vector(); + public Vector<String> getInstanceParams() { + Vector<String> confParams = new Vector<String>(); StringBuffer sb = new StringBuffer(); for (int i = 0; i < mConfigAlgs.length; i++) { @@ -343,7 +343,7 @@ public class SigningAlgorithmConstraints extends APolicyRule * * @return nvPairs A Vector of name/value pairs. */ - public Vector getDefaultParams() { + public Vector<String> getDefaultParams() { StringBuffer sb = new StringBuffer(); sb.append(PROP_ALGORITHMS); sb.append("="); diff --git a/pki/base/common/src/com/netscape/cms/policy/constraints/SubCANameConstraints.java b/pki/base/common/src/com/netscape/cms/policy/constraints/SubCANameConstraints.java index 2b13c14af..da63f6f24 100644 --- a/pki/base/common/src/com/netscape/cms/policy/constraints/SubCANameConstraints.java +++ b/pki/base/common/src/com/netscape/cms/policy/constraints/SubCANameConstraints.java @@ -176,8 +176,8 @@ public class SubCANameConstraints extends APolicyRule implements IEnrollmentPoli * * @return nvPairs A Vector of name/value pairs. */ - public Vector getInstanceParams() { - Vector v = new Vector(); + public Vector<String> getInstanceParams() { + Vector<String> v = new Vector<String>(); return v; } @@ -187,8 +187,8 @@ public class SubCANameConstraints extends APolicyRule implements IEnrollmentPoli * * @return nvPairs A Vector of name/value pairs. */ - public Vector getDefaultParams() { - Vector v = new Vector(); + public Vector<String> getDefaultParams() { + Vector<String> v = new Vector<String>(); return v; } diff --git a/pki/base/common/src/com/netscape/cms/policy/constraints/ValidityConstraints.java b/pki/base/common/src/com/netscape/cms/policy/constraints/ValidityConstraints.java index 1ebf9a0b8..0409f3c33 100644 --- a/pki/base/common/src/com/netscape/cms/policy/constraints/ValidityConstraints.java +++ b/pki/base/common/src/com/netscape/cms/policy/constraints/ValidityConstraints.java @@ -73,7 +73,7 @@ public class ValidityConstraints extends APolicyRule public final static long DAYS_TO_MS_FACTOR = 24L * 3600 * 1000; public final static long MINS_TO_MS_FACTOR = 60L * 1000; - private final static Vector defConfParams = new Vector(); + private final static Vector<String> defConfParams = new Vector<String>(); static { defConfParams.addElement(PROP_MIN_VALIDITY + "=" + @@ -260,8 +260,8 @@ public class ValidityConstraints extends APolicyRule * * @return nvPairs A Vector of name/value pairs. */ - public Vector getInstanceParams() { - Vector confParams = new Vector(); + public Vector<String> getInstanceParams() { + Vector<String> confParams = new Vector<String>(); confParams.addElement(PROP_MIN_VALIDITY + "=" + mMinValidity / DAYS_TO_MS_FACTOR); @@ -281,7 +281,7 @@ public class ValidityConstraints extends APolicyRule * * @return nvPairs A Vector of name/value pairs. */ - public Vector getDefaultParams() { + public Vector<String> getDefaultParams() { return defConfParams; } diff --git a/pki/base/common/src/com/netscape/cms/policy/extensions/BasicConstraintsExt.java b/pki/base/common/src/com/netscape/cms/policy/extensions/BasicConstraintsExt.java index 1d22d48ec..f830b7e3d 100644 --- a/pki/base/common/src/com/netscape/cms/policy/extensions/BasicConstraintsExt.java +++ b/pki/base/common/src/com/netscape/cms/policy/extensions/BasicConstraintsExt.java @@ -210,7 +210,6 @@ public class BasicConstraintsExt extends APolicyRule * @return The policy result object. */ public PolicyResult apply(IRequest req) { - PolicyResult res = PolicyResult.ACCEPTED; // get cert info. X509CertInfo[] ci = diff --git a/pki/base/common/src/com/netscape/cms/policy/extensions/CertificatePoliciesExt.java b/pki/base/common/src/com/netscape/cms/policy/extensions/CertificatePoliciesExt.java index 7ea2d6fb8..597357318 100644 --- a/pki/base/common/src/com/netscape/cms/policy/extensions/CertificatePoliciesExt.java +++ b/pki/base/common/src/com/netscape/cms/policy/extensions/CertificatePoliciesExt.java @@ -413,11 +413,9 @@ class CertPolicy { mNameDot + PROP_NOTICE_REF_ORG, msg)); // if a policy id is not null check that it is a valid OID. - ObjectIdentifier policyId = null; if (mPolicyId != null) - policyId = CMS.checkOID( - mNameDot + PROP_POLICY_IDENTIFIER, mPolicyId); + CMS.checkOID(mNameDot + PROP_POLICY_IDENTIFIER, mPolicyId); // if enabled, form CertificatePolicyInfo to be encoded in // extension. Policy ids should be all set. diff --git a/pki/base/common/src/com/netscape/cms/policy/extensions/KeyUsageExt.java b/pki/base/common/src/com/netscape/cms/policy/extensions/KeyUsageExt.java index 037206b89..6594cc4a2 100644 --- a/pki/base/common/src/com/netscape/cms/policy/extensions/KeyUsageExt.java +++ b/pki/base/common/src/com/netscape/cms/policy/extensions/KeyUsageExt.java @@ -159,7 +159,6 @@ public class KeyUsageExt extends APolicyRule * @return The policy result object. */ public PolicyResult apply(IRequest req) { - PolicyResult res = PolicyResult.ACCEPTED; X509CertInfo[] ci = req.getExtDataInCertInfoArray(IRequest.CERT_INFO); diff --git a/pki/base/common/src/com/netscape/cms/policy/extensions/NSCertTypeExt.java b/pki/base/common/src/com/netscape/cms/policy/extensions/NSCertTypeExt.java index 2d521e8d5..2fb09b2b7 100644 --- a/pki/base/common/src/com/netscape/cms/policy/extensions/NSCertTypeExt.java +++ b/pki/base/common/src/com/netscape/cms/policy/extensions/NSCertTypeExt.java @@ -159,7 +159,6 @@ public class NSCertTypeExt extends APolicyRule */ public PolicyResult apply(IRequest req) { CMS.debug("NSCertTypeExt: Impl: " + NAME + ", Instance: " + getInstanceName() + "::apply()"); - PolicyResult res = PolicyResult.ACCEPTED; X509CertInfo[] ci = req.getExtDataInCertInfoArray(IRequest.CERT_INFO); diff --git a/pki/base/common/src/com/netscape/cms/policy/extensions/PrivateKeyUsagePeriodExt.java b/pki/base/common/src/com/netscape/cms/policy/extensions/PrivateKeyUsagePeriodExt.java index fe2565428..3b80246a9 100644 --- a/pki/base/common/src/com/netscape/cms/policy/extensions/PrivateKeyUsagePeriodExt.java +++ b/pki/base/common/src/com/netscape/cms/policy/extensions/PrivateKeyUsagePeriodExt.java @@ -156,7 +156,6 @@ public class PrivateKeyUsagePeriodExt extends APolicyRule * @return The policy result object. */ public PolicyResult apply(IRequest req) { - PolicyResult res = PolicyResult.ACCEPTED; // get cert info. X509CertInfo[] ci = diff --git a/pki/base/common/src/com/netscape/cms/policy/extensions/RemoveBasicConstraintsExt.java b/pki/base/common/src/com/netscape/cms/policy/extensions/RemoveBasicConstraintsExt.java index 0af977a24..2a5af4240 100644 --- a/pki/base/common/src/com/netscape/cms/policy/extensions/RemoveBasicConstraintsExt.java +++ b/pki/base/common/src/com/netscape/cms/policy/extensions/RemoveBasicConstraintsExt.java @@ -61,7 +61,6 @@ public class RemoveBasicConstraintsExt extends APolicyRule } public PolicyResult apply(IRequest req) { - PolicyResult res = PolicyResult.ACCEPTED; // get cert info. X509CertInfo[] ci = diff --git a/pki/base/common/src/com/netscape/cms/policy/extensions/SubjectDirectoryAttributesExt.java b/pki/base/common/src/com/netscape/cms/policy/extensions/SubjectDirectoryAttributesExt.java index b4ebb4b45..6b4e7ead9 100644 --- a/pki/base/common/src/com/netscape/cms/policy/extensions/SubjectDirectoryAttributesExt.java +++ b/pki/base/common/src/com/netscape/cms/policy/extensions/SubjectDirectoryAttributesExt.java @@ -123,7 +123,6 @@ public class SubjectDirectoryAttributesExt extends APolicyRule } public PolicyResult apply(IRequest req) { - PolicyResult res = PolicyResult.ACCEPTED; X509CertInfo[] ci = req.getExtDataInCertInfoArray(IRequest.CERT_INFO); diff --git a/pki/base/common/src/com/netscape/cms/profile/common/BasicProfile.java b/pki/base/common/src/com/netscape/cms/profile/common/BasicProfile.java index 7f624cb8b..696d0cd13 100644 --- a/pki/base/common/src/com/netscape/cms/profile/common/BasicProfile.java +++ b/pki/base/common/src/com/netscape/cms/profile/common/BasicProfile.java @@ -550,12 +550,6 @@ public abstract class BasicProfile implements IProfile { throws EProfileException { IConfigStore outputStore = mConfig.getSubStore("output"); - String output_list = null; - - try { - output_list = outputStore.getString(PROP_OUTPUT_LIST, ""); - } catch (Exception ee) { - } IPluginInfo outputInfo = mRegistry.getPluginInfo("profileOutput", outputId); @@ -650,13 +644,6 @@ public abstract class BasicProfile implements IProfile { throws EProfileException { IConfigStore inputStore = mConfig.getSubStore("input"); - String input_list = null; - - try { - input_list = inputStore.getString(PROP_INPUT_LIST, ""); - } catch (Exception ee) { - } - IPluginInfo inputInfo = mRegistry.getPluginInfo("profileInput", inputId); @@ -856,14 +843,6 @@ public abstract class BasicProfile implements IProfile { CMS.debug("WARNING, can't get default plugin id!"); } - String constraintRoot = curId + "." + PROP_CONSTRAINT; - String curConstraintClassId = null; - try { - curConstraintClassId = pStore.getString(constraintRoot + "." + PROP_CLASS_ID); - } catch (Exception e) { - CMS.debug("WARNING, can't get constraint plugin id!"); - } - //Disallow duplicate defaults with the following exceptions: // noDefaultImpl, genericExtDefaultImpl diff --git a/pki/base/common/src/com/netscape/cms/profile/common/CACertCAEnrollProfile.java b/pki/base/common/src/com/netscape/cms/profile/common/CACertCAEnrollProfile.java index 3ad301b26..b95b22339 100644 --- a/pki/base/common/src/com/netscape/cms/profile/common/CACertCAEnrollProfile.java +++ b/pki/base/common/src/com/netscape/cms/profile/common/CACertCAEnrollProfile.java @@ -49,8 +49,7 @@ public class CACertCAEnrollProfile extends CAEnrollProfile createProfileOutput("o1", "certOutputImpl", outputParams1); // create policies - IProfilePolicy policy1 = - createProfilePolicy("set1", "p1", + createProfilePolicy("set1", "p1", "userSubjectNameDefaultImpl", "noConstraintImpl"); IProfilePolicy policy2 = diff --git a/pki/base/common/src/com/netscape/cms/profile/common/EnrollProfile.java b/pki/base/common/src/com/netscape/cms/profile/common/EnrollProfile.java index f2e921a53..d574f0f94 100644 --- a/pki/base/common/src/com/netscape/cms/profile/common/EnrollProfile.java +++ b/pki/base/common/src/com/netscape/cms/profile/common/EnrollProfile.java @@ -379,7 +379,6 @@ public abstract class EnrollProfile extends BasicProfile org.mozilla.jss.pkix.cms.SignedData cmcFullReq = (org.mozilla.jss.pkix.cms.SignedData) cmcReq.getInterpretedContent(); org.mozilla.jss.pkix.cms.EncapsulatedContentInfo ci = cmcFullReq.getContentInfo(); - OBJECT_IDENTIFIER id = ci.getContentType(); OCTET_STRING content = ci.getContent(); ByteArrayInputStream s = new ByteArrayInputStream(content.toByteArray()); @@ -1158,7 +1157,9 @@ public abstract class EnrollProfile extends BasicProfile /* get SPKAC Algorithm & Signature */ DerValue derSPKACContent[] = derIn.getSequence(3); + @SuppressWarnings("unused") AlgorithmId mAlgId = AlgorithmId.parse(derSPKACContent[1]); + @SuppressWarnings("unused") byte mSignature[] = derSPKACContent[2].getBitString(); /* get PKAC SPKI & Challenge */ @@ -1167,9 +1168,11 @@ public abstract class EnrollProfile extends BasicProfile derIn = new DerInputStream(mPKAC); DerValue derPKACContent[] = derIn.getSequence(2); + @SuppressWarnings("unused") DerValue mDerSPKI = derPKACContent[0]; X509Key mSPKI = X509Key.parse(derPKACContent[0]); + @SuppressWarnings("unused") String mChallenge; DerValue mDerChallenge = derPKACContent[1]; diff --git a/pki/base/common/src/com/netscape/cms/profile/constraint/KeyConstraint.java b/pki/base/common/src/com/netscape/cms/profile/constraint/KeyConstraint.java index 558338e7f..e6f5019a0 100644 --- a/pki/base/common/src/com/netscape/cms/profile/constraint/KeyConstraint.java +++ b/pki/base/common/src/com/netscape/cms/profile/constraint/KeyConstraint.java @@ -72,285 +72,285 @@ public class KeyConstraint extends EnrollConstraint { "sect131r1", "sect131r2" }; - private final static HashMap<String, Vector> ecOIDs = new HashMap<String, Vector>(); + private final static HashMap<String, Vector<String>> ecOIDs = new HashMap<String, Vector<String>>(); static { - ecOIDs.put("1.2.840.10045.3.1.7", new Vector() { + ecOIDs.put("1.2.840.10045.3.1.7", new Vector<String>() { { add("nistp256"); add("secp256r1"); } }); - ecOIDs.put("1.3.132.0.34", new Vector() { + ecOIDs.put("1.3.132.0.34", new Vector<String>() { { add("nistp384"); add("secp384r1"); } }); - ecOIDs.put("1.3.132.0.35", new Vector() { + ecOIDs.put("1.3.132.0.35", new Vector<String>() { { add("nistp521"); add("secp521r1"); } }); - ecOIDs.put("1.3.132.0.1", new Vector() { + ecOIDs.put("1.3.132.0.1", new Vector<String>() { { add("sect163k1"); add("nistk163"); } }); - ecOIDs.put("1.3.132.0.2", new Vector() { + ecOIDs.put("1.3.132.0.2", new Vector<String>() { { add("sect163r1"); } }); - ecOIDs.put("1.3.132.0.15", new Vector() { + ecOIDs.put("1.3.132.0.15", new Vector<String>() { { add("sect163r2"); add("nistb163"); } }); - ecOIDs.put("1.3.132.0.24", new Vector() { + ecOIDs.put("1.3.132.0.24", new Vector<String>() { { add("sect193r1"); } }); - ecOIDs.put("1.3.132.0.25", new Vector() { + ecOIDs.put("1.3.132.0.25", new Vector<String>() { { add("sect193r2"); } }); - ecOIDs.put("1.3.132.0.26", new Vector() { + ecOIDs.put("1.3.132.0.26", new Vector<String>() { { add("sect233k1"); add("nistk233"); } }); - ecOIDs.put("1.3.132.0.27", new Vector() { + ecOIDs.put("1.3.132.0.27", new Vector<String>() { { add("sect233r1"); add("nistb233"); } }); - ecOIDs.put("1.3.132.0.3", new Vector() { + ecOIDs.put("1.3.132.0.3", new Vector<String>() { { add("sect239k1"); } }); - ecOIDs.put("1.3.132.0.16", new Vector() { + ecOIDs.put("1.3.132.0.16", new Vector<String>() { { add("sect283k1"); add("nistk283"); } }); - ecOIDs.put("1.3.132.0.17", new Vector() { + ecOIDs.put("1.3.132.0.17", new Vector<String>() { { add("sect283r1"); add("nistb283"); } }); - ecOIDs.put("1.3.132.0.36", new Vector() { + ecOIDs.put("1.3.132.0.36", new Vector<String>() { { add("sect409k1"); add("nistk409"); } }); - ecOIDs.put("1.3.132.0.37", new Vector() { + ecOIDs.put("1.3.132.0.37", new Vector<String>() { { add("sect409r1"); add("nistb409"); } }); - ecOIDs.put("1.3.132.0.38", new Vector() { + ecOIDs.put("1.3.132.0.38", new Vector<String>() { { add("sect571k1"); add("nistk571"); } }); - ecOIDs.put("1.3.132.0.39", new Vector() { + ecOIDs.put("1.3.132.0.39", new Vector<String>() { { add("sect571r1"); add("nistb571"); } }); - ecOIDs.put("1.3.132.0.9", new Vector() { + ecOIDs.put("1.3.132.0.9", new Vector<String>() { { add("secp160k1"); } }); - ecOIDs.put("1.3.132.0.8", new Vector() { + ecOIDs.put("1.3.132.0.8", new Vector<String>() { { add("secp160r1"); } }); - ecOIDs.put("1.3.132.0.30", new Vector() { + ecOIDs.put("1.3.132.0.30", new Vector<String>() { { add("secp160r2"); } }); - ecOIDs.put("1.3.132.0.31", new Vector() { + ecOIDs.put("1.3.132.0.31", new Vector<String>() { { add("secp192k1"); } }); - ecOIDs.put("1.2.840.10045.3.1.1", new Vector() { + ecOIDs.put("1.2.840.10045.3.1.1", new Vector<String>() { { add("secp192r1"); add("nistp192"); add("prime192v1"); } }); - ecOIDs.put("1.3.132.0.32", new Vector() { + ecOIDs.put("1.3.132.0.32", new Vector<String>() { { add("secp224k1"); } }); - ecOIDs.put("1.3.132.0.33", new Vector() { + ecOIDs.put("1.3.132.0.33", new Vector<String>() { { add("secp224r1"); add("nistp224"); } }); - ecOIDs.put("1.3.132.0.10", new Vector() { + ecOIDs.put("1.3.132.0.10", new Vector<String>() { { add("secp256k1"); } }); - ecOIDs.put("1.2.840.10045.3.1.2", new Vector() { + ecOIDs.put("1.2.840.10045.3.1.2", new Vector<String>() { { add("prime192v2"); } }); - ecOIDs.put("1.2.840.10045.3.1.3", new Vector() { + ecOIDs.put("1.2.840.10045.3.1.3", new Vector<String>() { { add("prime192v3"); } }); - ecOIDs.put("1.2.840.10045.3.1.4", new Vector() { + ecOIDs.put("1.2.840.10045.3.1.4", new Vector<String>() { { add("prime239v1"); } }); - ecOIDs.put("1.2.840.10045.3.1.5", new Vector() { + ecOIDs.put("1.2.840.10045.3.1.5", new Vector<String>() { { add("prime239v2"); } }); - ecOIDs.put("1.2.840.10045.3.1.6", new Vector() { + ecOIDs.put("1.2.840.10045.3.1.6", new Vector<String>() { { add("prime239v3"); } }); - ecOIDs.put("1.2.840.10045.3.0.1", new Vector() { + ecOIDs.put("1.2.840.10045.3.0.1", new Vector<String>() { { add("c2pnb163v1"); } }); - ecOIDs.put("1.2.840.10045.3.0.2", new Vector() { + ecOIDs.put("1.2.840.10045.3.0.2", new Vector<String>() { { add("c2pnb163v2"); } }); - ecOIDs.put("1.2.840.10045.3.0.3", new Vector() { + ecOIDs.put("1.2.840.10045.3.0.3", new Vector<String>() { { add("c2pnb163v3"); } }); - ecOIDs.put("1.2.840.10045.3.0.4", new Vector() { + ecOIDs.put("1.2.840.10045.3.0.4", new Vector<String>() { { add("c2pnb176v1"); } }); - ecOIDs.put("1.2.840.10045.3.0.5", new Vector() { + ecOIDs.put("1.2.840.10045.3.0.5", new Vector<String>() { { add("c2tnb191v1"); } }); - ecOIDs.put("1.2.840.10045.3.0.6", new Vector() { + ecOIDs.put("1.2.840.10045.3.0.6", new Vector<String>() { { add("c2tnb191v2"); } }); - ecOIDs.put("1.2.840.10045.3.0.7", new Vector() { + ecOIDs.put("1.2.840.10045.3.0.7", new Vector<String>() { { add("c2tnb191v3"); } }); - ecOIDs.put("1.2.840.10045.3.0.10", new Vector() { + ecOIDs.put("1.2.840.10045.3.0.10", new Vector<String>() { { add("c2pnb208w1"); } }); - ecOIDs.put("1.2.840.10045.3.0.11", new Vector() { + ecOIDs.put("1.2.840.10045.3.0.11", new Vector<String>() { { add("c2tnb239v1"); } }); - ecOIDs.put("1.2.840.10045.3.0.12", new Vector() { + ecOIDs.put("1.2.840.10045.3.0.12", new Vector<String>() { { add("c2tnb239v2"); } }); - ecOIDs.put("1.2.840.10045.3.0.13", new Vector() { + ecOIDs.put("1.2.840.10045.3.0.13", new Vector<String>() { { add("c2tnb239v3"); } }); - ecOIDs.put("1.2.840.10045.3.0.16", new Vector() { + ecOIDs.put("1.2.840.10045.3.0.16", new Vector<String>() { { add("c2pnb272w1"); } }); - ecOIDs.put("1.2.840.10045.3.0.17", new Vector() { + ecOIDs.put("1.2.840.10045.3.0.17", new Vector<String>() { { add("c2pnb304w1"); } }); - ecOIDs.put("1.2.840.10045.3.0.19", new Vector() { + ecOIDs.put("1.2.840.10045.3.0.19", new Vector<String>() { { add("c2pnb368w1"); } }); - ecOIDs.put("1.2.840.10045.3.0.20", new Vector() { + ecOIDs.put("1.2.840.10045.3.0.20", new Vector<String>() { { add("c2tnb431r1"); } }); - ecOIDs.put("1.3.132.0.6", new Vector() { + ecOIDs.put("1.3.132.0.6", new Vector<String>() { { add("secp112r1"); } }); - ecOIDs.put("1.3.132.0.7", new Vector() { + ecOIDs.put("1.3.132.0.7", new Vector<String>() { { add("secp112r2"); } }); - ecOIDs.put("1.3.132.0.28", new Vector() { + ecOIDs.put("1.3.132.0.28", new Vector<String>() { { add("secp128r1"); } }); - ecOIDs.put("1.3.132.0.29", new Vector() { + ecOIDs.put("1.3.132.0.29", new Vector<String>() { { add("secp128r2"); } }); - ecOIDs.put("1.3.132.0.4", new Vector() { + ecOIDs.put("1.3.132.0.4", new Vector<String>() { { add("sect113r1"); } }); - ecOIDs.put("1.3.132.0.5", new Vector() { + ecOIDs.put("1.3.132.0.5", new Vector<String>() { { add("sect113r2"); } }); - ecOIDs.put("1.3.132.0.22", new Vector() { + ecOIDs.put("1.3.132.0.22", new Vector<String>() { { add("sect131r1"); } }); - ecOIDs.put("1.3.132.0.23", new Vector() { + ecOIDs.put("1.3.132.0.23", new Vector<String>() { { add("sect131r2"); } @@ -422,7 +422,6 @@ public class KeyConstraint extends EnrollConstraint { } int keySize = 0; - String ecCurve = ""; if (alg.equals("RSA")) { keySize = getRSAKeyLen(key); @@ -468,7 +467,7 @@ public class KeyConstraint extends EnrollConstraint { } CMS.debug("EC key OID: " + params); - Vector vect = ecOIDs.get(params); + Vector<String> vect = ecOIDs.get(params); boolean curveFound = false; diff --git a/pki/base/common/src/com/netscape/cms/profile/constraint/SigningAlgConstraint.java b/pki/base/common/src/com/netscape/cms/profile/constraint/SigningAlgConstraint.java index 2125bb81e..4dbe329b3 100644 --- a/pki/base/common/src/com/netscape/cms/profile/constraint/SigningAlgConstraint.java +++ b/pki/base/common/src/com/netscape/cms/profile/constraint/SigningAlgConstraint.java @@ -117,7 +117,7 @@ public class SigningAlgConstraint extends EnrollConstraint { AlgorithmId id = (AlgorithmId) algId.get(CertificateAlgorithmId.ALGORITHM); - Vector mCache = new Vector(); + Vector<String> mCache = new Vector<String>(); StringTokenizer st = new StringTokenizer( getConfig(CONFIG_ALGORITHMS_ALLOWED), ","); diff --git a/pki/base/common/src/com/netscape/cms/profile/def/AuthInfoAccessExtDefault.java b/pki/base/common/src/com/netscape/cms/profile/def/AuthInfoAccessExtDefault.java index 76ea4e143..4e4f951f7 100644 --- a/pki/base/common/src/com/netscape/cms/profile/def/AuthInfoAccessExtDefault.java +++ b/pki/base/common/src/com/netscape/cms/profile/def/AuthInfoAccessExtDefault.java @@ -340,7 +340,7 @@ public class AuthInfoAccessExtDefault extends EnrollExtDefault { int num = getNumAds(); CMS.debug("AuthInfoAccess num=" + num); - Vector recs = new Vector(); + Vector<NameValuePairs> recs = new Vector<NameValuePairs>(); for (int i = 0; i < num; i++) { NameValuePairs np = new NameValuePairs(); @@ -375,7 +375,6 @@ public class AuthInfoAccessExtDefault extends EnrollExtDefault { public String getText(Locale locale) { StringBuffer ads = new StringBuffer(); - String numAds = getConfig(CONFIG_NUM_ADS); int num = getNumAds(); for (int i = 0; i < num; i++) { diff --git a/pki/base/common/src/com/netscape/cms/profile/def/CRLDistributionPointsExtDefault.java b/pki/base/common/src/com/netscape/cms/profile/def/CRLDistributionPointsExtDefault.java index c7a0f9abd..d1def3d5d 100644 --- a/pki/base/common/src/com/netscape/cms/profile/def/CRLDistributionPointsExtDefault.java +++ b/pki/base/common/src/com/netscape/cms/profile/def/CRLDistributionPointsExtDefault.java @@ -434,8 +434,6 @@ public class CRLDistributionPointsExtDefault extends EnrollExtDefault { if (ext == null) return ""; - StringBuffer sb = new StringBuffer(); - Vector<NameValuePairs> recs = new Vector<NameValuePairs>(); int num = getNumPoints(); @@ -497,7 +495,6 @@ public class CRLDistributionPointsExtDefault extends EnrollExtDefault { if (gn != null) { hasFullName = true; - int type = gn.getType(); pairs.put(POINT_TYPE, getGeneralNameType(gn)); pairs.put(POINT_NAME, getGeneralNameValue(gn)); @@ -528,7 +525,6 @@ public class CRLDistributionPointsExtDefault extends EnrollExtDefault { if (gn != null) { hasFullName = true; - int type = gn.getType(); pairs.put(ISSUER_TYPE, getGeneralNameType(gn)); pairs.put(ISSUER_NAME, getGeneralNameValue(gn)); diff --git a/pki/base/common/src/com/netscape/cms/profile/def/EnrollDefault.java b/pki/base/common/src/com/netscape/cms/profile/def/EnrollDefault.java index 5310986d5..67ebadbe4 100644 --- a/pki/base/common/src/com/netscape/cms/profile/def/EnrollDefault.java +++ b/pki/base/common/src/com/netscape/cms/profile/def/EnrollDefault.java @@ -396,7 +396,6 @@ public abstract class EnrollDefault implements IPolicyDefault, ICertInfoPolicyDe int pos = name.indexOf(':'); if (pos == -1) return false; - String nameType = name.substring(0, pos).trim(); String nameValue = name.substring(pos + 1).trim(); if (nameValue.equals("")) return false; @@ -480,7 +479,7 @@ public abstract class EnrollDefault implements IPolicyDefault, ICertInfoPolicyDe if (nameType.equalsIgnoreCase("OIDName")) { try { // check if OID - ObjectIdentifier oid = new ObjectIdentifier(nameValue); + new ObjectIdentifier(nameValue); } catch (Exception e) { return null; } diff --git a/pki/base/common/src/com/netscape/cms/profile/def/FreshestCRLExtDefault.java b/pki/base/common/src/com/netscape/cms/profile/def/FreshestCRLExtDefault.java index 739fd3448..acbbd1089 100644 --- a/pki/base/common/src/com/netscape/cms/profile/def/FreshestCRLExtDefault.java +++ b/pki/base/common/src/com/netscape/cms/profile/def/FreshestCRLExtDefault.java @@ -379,8 +379,6 @@ public class FreshestCRLExtDefault extends EnrollExtDefault { if (ext == null) return ""; - StringBuffer sb = new StringBuffer(); - Vector<NameValuePairs> recs = new Vector<NameValuePairs>(); int num = getNumPoints(); for (int i = 0; i < num; i++) { @@ -431,7 +429,6 @@ public class FreshestCRLExtDefault extends EnrollExtDefault { if (gn != null) { hasFullName = true; - int type = gn.getType(); pairs.put(POINT_TYPE, getGeneralNameType(gn)); pairs.put(POINT_NAME, getGeneralNameValue(gn)); @@ -453,7 +450,6 @@ public class FreshestCRLExtDefault extends EnrollExtDefault { if (gn != null) { hasFullName = true; - int type = gn.getType(); pairs.put(ISSUER_TYPE, getGeneralNameType(gn)); pairs.put(ISSUER_NAME, getGeneralNameValue(gn)); diff --git a/pki/base/common/src/com/netscape/cms/profile/def/PolicyMappingsExtDefault.java b/pki/base/common/src/com/netscape/cms/profile/def/PolicyMappingsExtDefault.java index 1f05fef3e..712641c0d 100644 --- a/pki/base/common/src/com/netscape/cms/profile/def/PolicyMappingsExtDefault.java +++ b/pki/base/common/src/com/netscape/cms/profile/def/PolicyMappingsExtDefault.java @@ -310,9 +310,6 @@ public class PolicyMappingsExtDefault extends EnrollExtDefault { Enumeration<CertificatePolicyMap> maps = ext.getMappings(); - int num = 0; - StringBuffer sb = new StringBuffer(); - Vector<NameValuePairs> recs = new Vector<NameValuePairs>(); for (int i = 0; i < num_mappings; i++) { @@ -346,7 +343,6 @@ public class PolicyMappingsExtDefault extends EnrollExtDefault { public String getText(Locale locale) { StringBuffer sb = new StringBuffer(); - String numMappings = getConfig(CONFIG_NUM_POLICY_MAPPINGS); int num = getNumMappings(); for (int i = 0; i < num; i++) { diff --git a/pki/base/common/src/com/netscape/cms/profile/def/SubjectAltNameExtDefault.java b/pki/base/common/src/com/netscape/cms/profile/def/SubjectAltNameExtDefault.java index b205f7df4..d3838577e 100644 --- a/pki/base/common/src/com/netscape/cms/profile/def/SubjectAltNameExtDefault.java +++ b/pki/base/common/src/com/netscape/cms/profile/def/SubjectAltNameExtDefault.java @@ -382,7 +382,6 @@ public class SubjectAltNameExtDefault extends EnrollExtDefault { */ public String getText(Locale locale) { StringBuffer sb = new StringBuffer(); - String numGNs = getConfig(CONFIG_NUM_GNS); int num = getNumGNs(); for (int i = 0; i < num; i++) { diff --git a/pki/base/common/src/com/netscape/cms/profile/def/SubjectInfoAccessExtDefault.java b/pki/base/common/src/com/netscape/cms/profile/def/SubjectInfoAccessExtDefault.java index 104b29a08..8ea7533cc 100644 --- a/pki/base/common/src/com/netscape/cms/profile/def/SubjectInfoAccessExtDefault.java +++ b/pki/base/common/src/com/netscape/cms/profile/def/SubjectInfoAccessExtDefault.java @@ -335,7 +335,7 @@ public class SubjectInfoAccessExtDefault extends EnrollExtDefault { int num = getNumAds(); CMS.debug("SubjectInfoAccess num=" + num); - Vector recs = new Vector(); + Vector<NameValuePairs> recs = new Vector<NameValuePairs>(); for (int i = 0; i < num; i++) { NameValuePairs np = new NameValuePairs(); @@ -370,7 +370,6 @@ public class SubjectInfoAccessExtDefault extends EnrollExtDefault { public String getText(Locale locale) { StringBuffer ads = new StringBuffer(); - String numAds = getConfig(CONFIG_NUM_ADS); int num = getNumAds(); for (int i = 0; i < num; i++) { 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 abdc770ba..bbf641540 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 @@ -264,11 +264,6 @@ public class LdapCaSimpleMap implements ILdapMapper, IExtendedPluginInfo { "organizationalPerson", "inetOrgPerson" }; - String oOc[] = { "top", - "organization" }; - String oiOc[] = { "top", - "organizationalunit" }; - DN dnobj = new DN(dn); String attrval[] = dnobj.explodeDN(true); diff --git a/pki/base/common/src/com/netscape/cms/publish/mappers/LdapCrlIssuerCompsMap.java b/pki/base/common/src/com/netscape/cms/publish/mappers/LdapCrlIssuerCompsMap.java index 4451706a3..654de5d30 100644 --- a/pki/base/common/src/com/netscape/cms/publish/mappers/LdapCrlIssuerCompsMap.java +++ b/pki/base/common/src/com/netscape/cms/publish/mappers/LdapCrlIssuerCompsMap.java @@ -83,15 +83,15 @@ public class LdapCrlIssuerCompsMap return "LdapCrlIssuerCompsMap"; } - public Vector getDefaultParams() { - Vector v = super.getDefaultParams(); + public Vector<String> getDefaultParams() { + Vector<String> v = super.getDefaultParams(); //v.addElement("crlAttr=" + LdapCrlPublisher.LDAP_CRL_ATTR); 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/NoMap.java b/pki/base/common/src/com/netscape/cms/publish/mappers/NoMap.java index cddc589bd..155c54ce0 100644 --- a/pki/base/common/src/com/netscape/cms/publish/mappers/NoMap.java +++ b/pki/base/common/src/com/netscape/cms/publish/mappers/NoMap.java @@ -91,13 +91,13 @@ public class NoMap implements ILdapMapper, IExtendedPluginInfo { return "NoMap"; } - 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/publishers/FileBasedPublisher.java b/pki/base/common/src/com/netscape/cms/publish/publishers/FileBasedPublisher.java index 5e8ad1282..cb13b2452 100644 --- a/pki/base/common/src/com/netscape/cms/publish/publishers/FileBasedPublisher.java +++ b/pki/base/common/src/com/netscape/cms/publish/publishers/FileBasedPublisher.java @@ -181,7 +181,6 @@ public class FileBasedPublisher implements ILdapPublisher, IExtendedPluginInfo { public void init(IConfigStore config) { mConfig = config; String dir = null; - String ext = null; try { dir = mConfig.getString(PROP_DIR, null); @@ -366,8 +365,6 @@ public class FileBasedPublisher implements ILdapPublisher, IExtendedPluginInfo { if (encodedArray == null) encodedArray = crl.getEncoded(); - ByteArrayOutputStream os = new ByteArrayOutputStream(); - fos = new FileOutputStream(tempFile); fos.write(Utils.base64encode(encodedArray).getBytes()); fos.close(); diff --git a/pki/base/common/src/com/netscape/cms/publish/publishers/LdapCaCertPublisher.java b/pki/base/common/src/com/netscape/cms/publish/publishers/LdapCaCertPublisher.java index 29b874a94..e47318b76 100644 --- a/pki/base/common/src/com/netscape/cms/publish/publishers/LdapCaCertPublisher.java +++ b/pki/base/common/src/com/netscape/cms/publish/publishers/LdapCaCertPublisher.java @@ -93,16 +93,16 @@ public class LdapCaCertPublisher return "LdapCaCertPublisher"; } - public Vector getInstanceParams() { - Vector v = new Vector(); + public Vector<String> getInstanceParams() { + Vector<String> v = new Vector<String>(); v.addElement("caCertAttr=" + mCaCertAttr); v.addElement("caObjectClass=" + mCaObjectclass); return v; } - public Vector getDefaultParams() { - Vector v = new Vector(); + public Vector<String> getDefaultParams() { + Vector<String> v = new Vector<String>(); v.addElement("caCertAttr=" + mCaCertAttr); v.addElement("caObjectClass=" + mCaObjectclass); diff --git a/pki/base/common/src/com/netscape/cms/publish/publishers/LdapCertSubjPublisher.java b/pki/base/common/src/com/netscape/cms/publish/publishers/LdapCertSubjPublisher.java index 5975872ff..9000f6834 100644 --- a/pki/base/common/src/com/netscape/cms/publish/publishers/LdapCertSubjPublisher.java +++ b/pki/base/common/src/com/netscape/cms/publish/publishers/LdapCertSubjPublisher.java @@ -74,16 +74,16 @@ public class LdapCertSubjPublisher implements ILdapPublisher { return "LdapCertSubjPublisher"; } - public Vector getInstanceParams() { - Vector v = new Vector(); + public Vector<String> getInstanceParams() { + Vector<String> v = new Vector<String>(); v.addElement("certAttr=" + mCertAttr); v.addElement("subjectNameAttr=" + mSubjNameAttr); return v; } - public Vector getDefaultParams() { - Vector v = new Vector(); + public Vector<String> getDefaultParams() { + Vector<String> v = new Vector<String>(); v.addElement("certAttr=" + mCertAttr); v.addElement("subjectNameAttr=" + mSubjNameAttr); diff --git a/pki/base/common/src/com/netscape/cms/publish/publishers/LdapCertificatePairPublisher.java b/pki/base/common/src/com/netscape/cms/publish/publishers/LdapCertificatePairPublisher.java index 624cb1478..c65ff79d5 100644 --- a/pki/base/common/src/com/netscape/cms/publish/publishers/LdapCertificatePairPublisher.java +++ b/pki/base/common/src/com/netscape/cms/publish/publishers/LdapCertificatePairPublisher.java @@ -91,20 +91,20 @@ public class LdapCertificatePairPublisher return "LdapCertificatePairPublisher"; } - public Vector getInstanceParams() { - Vector v = new Vector(); + public Vector<String> getInstanceParams() { + Vector<String> v = new Vector<String>(); v.addElement("crossCertPairAttr=" + mCrossCertPairAttr); v.addElement("caObjectClass=" + mCaObjectclass); return v; } - public Vector getInstanceParamsWithExtras() { + public Vector<String> getInstanceParamsWithExtras() { return getInstanceParams(); } - public Vector getDefaultParams() { - Vector v = new Vector(); + public Vector<String> getDefaultParams() { + Vector<String> v = new Vector<String>(); v.addElement("crossCertPairAttr=" + mCrossCertPairAttr); v.addElement("caObjectClass=" + mCaObjectclass); diff --git a/pki/base/common/src/com/netscape/cms/publish/publishers/LdapCrlPublisher.java b/pki/base/common/src/com/netscape/cms/publish/publishers/LdapCrlPublisher.java index 7c069f398..6826cc801 100644 --- a/pki/base/common/src/com/netscape/cms/publish/publishers/LdapCrlPublisher.java +++ b/pki/base/common/src/com/netscape/cms/publish/publishers/LdapCrlPublisher.java @@ -93,16 +93,16 @@ public class LdapCrlPublisher implements ILdapPublisher, IExtendedPluginInfo { return params; } - public Vector getInstanceParams() { - Vector v = new Vector(); + public Vector<String> getInstanceParams() { + Vector<String> v = new Vector<String>(); v.addElement("crlAttr=" + mCrlAttr); v.addElement("crlObjectClass=" + mCrlObjectClass); return v; } - public Vector getDefaultParams() { - Vector v = new Vector(); + public Vector<String> getDefaultParams() { + Vector<String> v = new Vector<String>(); v.addElement("crlAttr=" + mCrlAttr); v.addElement("crlObjectClass=" + mCrlObjectClass); diff --git a/pki/base/common/src/com/netscape/cms/publish/publishers/LdapUserCertPublisher.java b/pki/base/common/src/com/netscape/cms/publish/publishers/LdapUserCertPublisher.java index 0eba679ad..e31ce674c 100644 --- a/pki/base/common/src/com/netscape/cms/publish/publishers/LdapUserCertPublisher.java +++ b/pki/base/common/src/com/netscape/cms/publish/publishers/LdapUserCertPublisher.java @@ -79,15 +79,15 @@ public class LdapUserCertPublisher implements ILdapPublisher, IExtendedPluginInf } - public Vector getInstanceParams() { - Vector v = new Vector(); + public Vector<String> getInstanceParams() { + Vector<String> v = new Vector<String>(); v.addElement("certAttr=" + mCertAttr); return v; } - public Vector getDefaultParams() { - Vector v = new Vector(); + public Vector<String> getDefaultParams() { + Vector<String> v = new Vector<String>(); v.addElement("certAttr=" + mCertAttr); return v; diff --git a/pki/base/common/src/com/netscape/cms/publish/publishers/PublisherUtils.java b/pki/base/common/src/com/netscape/cms/publish/publishers/PublisherUtils.java index 314e87e63..af8d283dd 100644 --- a/pki/base/common/src/com/netscape/cms/publish/publishers/PublisherUtils.java +++ b/pki/base/common/src/com/netscape/cms/publish/publishers/PublisherUtils.java @@ -126,7 +126,7 @@ public class PublisherUtils { * there'll be trouble if the Vector contains something other * than just Strings */ - public static String[] getStringArrayFromVector(Vector v) { + public static String[] getStringArrayFromVector(Vector<String> v) { String s[] = new String[v.size()]; v.copyInto(s); diff --git a/pki/base/common/src/com/netscape/cms/request/RequestScheduler.java b/pki/base/common/src/com/netscape/cms/request/RequestScheduler.java index 089793bbe..e0ebaefc4 100644 --- a/pki/base/common/src/com/netscape/cms/request/RequestScheduler.java +++ b/pki/base/common/src/com/netscape/cms/request/RequestScheduler.java @@ -31,7 +31,7 @@ import com.netscape.certsrv.request.IRequestScheduler; * @version $Revision$, $Date$ */ public class RequestScheduler implements IRequestScheduler { - private Vector mRequestThreads = new Vector(); + private Vector<Thread> mRequestThreads = new Vector<Thread>(); /** * Request entered the request queue processing. diff --git a/pki/base/common/src/com/netscape/cms/servlet/admin/ACLAdminServlet.java b/pki/base/common/src/com/netscape/cms/servlet/admin/ACLAdminServlet.java index bde075334..12575675c 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/admin/ACLAdminServlet.java +++ b/pki/base/common/src/com/netscape/cms/servlet/admin/ACLAdminServlet.java @@ -20,7 +20,6 @@ package com.netscape.cms.servlet.admin; import java.io.IOException; import java.util.Enumeration; import java.util.Hashtable; -import java.util.Locale; import javax.servlet.ServletConfig; import javax.servlet.ServletException; @@ -34,7 +33,6 @@ import com.netscape.certsrv.apps.CMS; import com.netscape.certsrv.authorization.IAuthzManager; import com.netscape.certsrv.base.EBaseException; import com.netscape.certsrv.base.IConfigStore; -import com.netscape.certsrv.base.SessionContext; import com.netscape.certsrv.common.Constants; import com.netscape.certsrv.common.NameValuePairs; import com.netscape.certsrv.common.OpDef; @@ -42,7 +40,6 @@ import com.netscape.certsrv.common.ScopeDef; import com.netscape.certsrv.evaluators.IAccessEvaluator; import com.netscape.certsrv.logging.ILogger; import com.netscape.certsrv.usrgrp.IUGSubsystem; -import com.netscape.certsrv.usrgrp.IUser; /** * Manage Access Control List configuration @@ -119,8 +116,6 @@ public class ACLAdminServlet extends AdminServlet { return; } - Locale clientLocale = super.getLocale(req); - try { super.authenticate(req); } catch (IOException e) { @@ -130,21 +125,6 @@ public class ACLAdminServlet extends AdminServlet { return; } - IUser user = null; - - try { - SessionContext mSC = SessionContext.getContext(); - - user = (IUser) - mSC.get(SessionContext.USER); - } catch (Exception e) { - log(ILogger.LL_FAILURE, e.toString()); - sendResponse(ERROR, - CMS.getUserMessage(getLocale(req), "CMS_ADMIN_SRVLT_PERFORM_FAILED"), - null, resp); - return; - } - try { AUTHZ_RES_NAME = "certServer.acl.configuration"; diff --git a/pki/base/common/src/com/netscape/cms/servlet/admin/AdminServlet.java b/pki/base/common/src/com/netscape/cms/servlet/admin/AdminServlet.java index c7d7d619e..dbcba085d 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/admin/AdminServlet.java +++ b/pki/base/common/src/com/netscape/cms/servlet/admin/AdminServlet.java @@ -354,10 +354,6 @@ public class AdminServlet extends HttpServlet { SessionContext sc = SessionContext.getContext(); IAuthToken token = null; - // a kludge for the desperately pinging console - String scope = req.getParameter(Constants.OP_SCOPE); - String op = req.getParameter(Constants.OP_TYPE); - log(ILogger.LL_DEBUG, CMS.getLogMessage("ADMIN_SRVLT_ABOUT_AUTH", mServletID)); try { diff --git a/pki/base/common/src/com/netscape/cms/servlet/admin/LogAdminServlet.java b/pki/base/common/src/com/netscape/cms/servlet/admin/LogAdminServlet.java index be723fcd6..1b32018bc 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/admin/LogAdminServlet.java +++ b/pki/base/common/src/com/netscape/cms/servlet/admin/LogAdminServlet.java @@ -339,7 +339,6 @@ public class LogAdminServlet extends AdminServlet { IOException, EBaseException { NameValuePairs params = new NameValuePairs(); - String insts = null; Enumeration<String> e = mSys.getLogInsts().keys(); for (; e.hasMoreElements();) { @@ -1148,10 +1147,7 @@ public class LogAdminServlet extends AdminServlet { // only remove from memory // cannot shutdown because we don't keep track of whether it's // being used. - ILogEventListener logInst = (ILogEventListener) - mSys.getLogInstance(id); - - mSys.getLogInsts().remove((Object) id); + mSys.getLogInsts().remove(id); // remove the configuration. IConfigStore destStore = @@ -1453,7 +1449,6 @@ public class LogAdminServlet extends AdminServlet { // to the signed audit log and stored as failures try { String id = req.getParameter(Constants.RS_ID); - String type = ""; // if this "required" parameter is not present, // always log messages to the signed audit log @@ -1670,10 +1665,6 @@ public class LogAdminServlet extends AdminServlet { val = Integer.toString(60 * 60 * 24 * 365); } - if (key.equals(Constants.PR_LOG_TYPE)) { - type = val; - } - if (val != null) { if (key.equals("fileName")) { String origVal = substore.getString(key); @@ -1771,6 +1762,7 @@ public class LogAdminServlet extends AdminServlet { // Instantiate an object for new implementation String className = plugin.getClassPath(); + @SuppressWarnings("unused") ILogEventListener newMgrInst = null; try { diff --git a/pki/base/common/src/com/netscape/cms/servlet/admin/OCSPAdminServlet.java b/pki/base/common/src/com/netscape/cms/servlet/admin/OCSPAdminServlet.java index 59eead9df..0e6784413 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/admin/OCSPAdminServlet.java +++ b/pki/base/common/src/com/netscape/cms/servlet/admin/OCSPAdminServlet.java @@ -491,7 +491,6 @@ public class OCSPAdminServlet extends AdminServlet { try { @SuppressWarnings("unchecked") Enumeration<String> enum1 = req.getParameterNames(); - boolean restart = false; while (enum1.hasMoreElements()) { String key = (String) enum1.nextElement(); diff --git a/pki/base/common/src/com/netscape/cms/servlet/admin/PolicyAdminServlet.java b/pki/base/common/src/com/netscape/cms/servlet/admin/PolicyAdminServlet.java index 9eb5c3455..f656cbd44 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/admin/PolicyAdminServlet.java +++ b/pki/base/common/src/com/netscape/cms/servlet/admin/PolicyAdminServlet.java @@ -465,7 +465,6 @@ public class PolicyAdminServlet extends AdminServlet { // Assemble name value pairs NameValuePairs nvp = new NameValuePairs(); - String instName, rest; while (instancesInfo.hasMoreElements()) { String info = instancesInfo.nextElement(); diff --git a/pki/base/common/src/com/netscape/cms/servlet/admin/PublisherAdminServlet.java b/pki/base/common/src/com/netscape/cms/servlet/admin/PublisherAdminServlet.java index 3774d6e6f..483ac42ef 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/admin/PublisherAdminServlet.java +++ b/pki/base/common/src/com/netscape/cms/servlet/admin/PublisherAdminServlet.java @@ -372,7 +372,6 @@ public class PublisherAdminServlet extends AdminServlet { if (implType.equals(Constants.PR_EXT_PLUGIN_IMPLTYPE_PUBLISHRULE)) { IPublisherProcessor p_processor = mProcessor; - RulePlugin plugin = p_processor.getRulePlugins().get(implName); // Should get the registered rules from processor // instead of plugin @@ -1324,10 +1323,7 @@ public class PublisherAdminServlet extends AdminServlet { // only remove from memory // cannot shutdown because we don't keep track of whether it's // being used. - ILdapMapper mapperInst = (ILdapMapper) - mProcessor.getMapperInstance(id); - - mProcessor.getMapperInsts().remove((Object) id); + mProcessor.getMapperInsts().remove(id); // remove the configuration. IConfigStore destStore = @@ -2019,10 +2015,7 @@ public class PublisherAdminServlet extends AdminServlet { // only remove from memory // cannot shutdown because we don't keep track of whether it's // being used. - ILdapRule ruleInst = (ILdapRule) - mProcessor.getRuleInsts().get(id); - - mProcessor.getRuleInsts().remove((Object) id); + mProcessor.getRuleInsts().remove(id); // remove the configuration. IConfigStore destStore = @@ -2674,9 +2667,7 @@ public class PublisherAdminServlet extends AdminServlet { // only remove from memory // cannot shutdown because we don't keep track of whether it's // being used. - ILdapPublisher publisherInst = mProcessor.getPublisherInstance(id); - - mProcessor.getPublisherInsts().remove((Object) id); + mProcessor.getPublisherInsts().remove(id); // remove the configuration. IConfigStore destStore = diff --git a/pki/base/common/src/com/netscape/cms/servlet/admin/RegistryAdminServlet.java b/pki/base/common/src/com/netscape/cms/servlet/admin/RegistryAdminServlet.java index aa5494f0d..4bebe85d3 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/admin/RegistryAdminServlet.java +++ b/pki/base/common/src/com/netscape/cms/servlet/admin/RegistryAdminServlet.java @@ -155,7 +155,6 @@ public class RegistryAdminServlet extends AdminServlet { throws ServletException, IOException { // Get operation type String op = req.getParameter(Constants.OP_TYPE); - String scope = req.getParameter(Constants.OP_SCOPE); if (op.equals(OpDef.OP_SEARCH)) { if (!readAuthorize(req, resp)) diff --git a/pki/base/common/src/com/netscape/cms/servlet/base/DynamicVariablesServlet.java b/pki/base/common/src/com/netscape/cms/servlet/base/DynamicVariablesServlet.java index b0a97e9b5..0bf726879 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/base/DynamicVariablesServlet.java +++ b/pki/base/common/src/com/netscape/cms/servlet/base/DynamicVariablesServlet.java @@ -34,7 +34,6 @@ import com.netscape.certsrv.apps.CMS; import com.netscape.certsrv.authentication.AuthMgrPlugin; import com.netscape.certsrv.authentication.IAuthManager; import com.netscape.certsrv.authentication.IAuthSubsystem; -import com.netscape.certsrv.authentication.IAuthToken; import com.netscape.certsrv.base.EBaseException; import com.netscape.certsrv.base.IConfigStore; @@ -200,7 +199,7 @@ public class DynamicVariablesServlet extends CMSServlet { if (mAuthMgr != null) { try { - IAuthToken token = authenticate(httpReq); + authenticate(httpReq); } catch (EBaseException e) { mServletCtx.log(CMS.getLogMessage("CMSGW_FILE_NO_ACCESS", e.toString())); httpResp.sendError(HttpServletResponse.SC_FORBIDDEN); diff --git a/pki/base/common/src/com/netscape/cms/servlet/cert/CMCRevReqServlet.java b/pki/base/common/src/com/netscape/cms/servlet/cert/CMCRevReqServlet.java index 0dfe4a26c..5af09ad0d 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/cert/CMCRevReqServlet.java +++ b/pki/base/common/src/com/netscape/cms/servlet/cert/CMCRevReqServlet.java @@ -200,7 +200,6 @@ public class CMCRevReqServlet extends CMSServlet { if (authToken != null) { reasonCode = authToken.getInInteger(REASON_CODE); } - RevocationReason reason = RevocationReason.fromInt(reasonCode.intValue()); String comments = ""; Date invalidityDate = null; diff --git a/pki/base/common/src/com/netscape/cms/servlet/cert/DisplayBySerial.java b/pki/base/common/src/com/netscape/cms/servlet/cert/DisplayBySerial.java index 4c0b56f0b..5a1e4ed65 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/cert/DisplayBySerial.java +++ b/pki/base/common/src/com/netscape/cms/servlet/cert/DisplayBySerial.java @@ -160,7 +160,7 @@ public class DisplayBySerial extends CMSServlet { } serialNumber = getSerialNumber(req); - ICertRecord rec = getCertRecord(serialNumber, certType); + getCertRecord(serialNumber, certType); //throw exception on error if (certType[0].equalsIgnoreCase("x509")) { form = getTemplate(mForm1Path, req, locale); @@ -230,7 +230,7 @@ public class DisplayBySerial extends CMSServlet { String certType[] = new String[1]; try { - ICertRecord rec = getCertRecord(seq, certType); + getCertRecord(seq, certType); // throw exception on error if (certType[0].equalsIgnoreCase("x509")) { processX509(argSet, header, seq, req, resp, locale); diff --git a/pki/base/common/src/com/netscape/cms/servlet/cert/DoRevoke.java b/pki/base/common/src/com/netscape/cms/servlet/cert/DoRevoke.java index b84f5ace1..1594c5323 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/cert/DoRevoke.java +++ b/pki/base/common/src/com/netscape/cms/servlet/cert/DoRevoke.java @@ -291,7 +291,7 @@ public class DoRevoke extends CMSServlet { if (authToken != null) { String serialNumber = req.getParameter("serialNumber"); - X509CertImpl sslCert = (X509CertImpl) getSSLClientCertificate(req); + getSSLClientCertificate(req); // throw exception on error if (serialNumber != null) { eeSerialNumber = serialNumber; diff --git a/pki/base/common/src/com/netscape/cms/servlet/cert/DoRevokeTPS.java b/pki/base/common/src/com/netscape/cms/servlet/cert/DoRevokeTPS.java index 853fa1e45..c4603dd51 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/cert/DoRevokeTPS.java +++ b/pki/base/common/src/com/netscape/cms/servlet/cert/DoRevokeTPS.java @@ -27,7 +27,6 @@ import java.math.BigInteger; import javax.servlet.ServletConfig; import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -254,8 +253,6 @@ public class DoRevokeTPS extends CMSServlet { } try { - ServletOutputStream out = resp.getOutputStream(); - if (!authorized) { o_status = "status=3"; errorString = "error=unauthorized"; @@ -684,19 +681,6 @@ public class DoRevokeTPS extends CMSServlet { if (mPublisherProcessor != null && mPublisherProcessor.ldapEnabled()) { header.addStringValue("dirEnabled", "yes"); - Integer[] ldapPublishStatus = - revReq.getExtDataInIntegerArray("ldapPublishStatus"); - int certsToUpdate = 0; - int certsUpdated = 0; - - if (ldapPublishStatus != null) { - certsToUpdate = ldapPublishStatus.length; - for (int i = 0; i < certsToUpdate; i++) { - if (ldapPublishStatus[i] == IRequest.RES_SUCCESS) { - certsUpdated++; - } - } - } // add crl publishing status. String publError = diff --git a/pki/base/common/src/com/netscape/cms/servlet/cert/DoUnrevoke.java b/pki/base/common/src/com/netscape/cms/servlet/cert/DoUnrevoke.java index c5fb568f2..c6b6065b4 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/cert/DoUnrevoke.java +++ b/pki/base/common/src/com/netscape/cms/servlet/cert/DoUnrevoke.java @@ -577,7 +577,7 @@ public class DoUnrevoke extends CMSServlet { String serialNumString = req.getParameter("serialNumber"); StringTokenizer snList = new StringTokenizer(serialNumString, " "); - Vector biList = new Vector(); + Vector<BigInteger> biList = new Vector<BigInteger>(); while (snList.hasMoreTokens()) { String snStr = snList.nextToken(); if (snStr != null) { diff --git a/pki/base/common/src/com/netscape/cms/servlet/cert/DoUnrevokeTPS.java b/pki/base/common/src/com/netscape/cms/servlet/cert/DoUnrevokeTPS.java index 969619815..5d096aff3 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/cert/DoUnrevokeTPS.java +++ b/pki/base/common/src/com/netscape/cms/servlet/cert/DoUnrevokeTPS.java @@ -27,7 +27,6 @@ import java.util.Vector; import javax.servlet.ServletConfig; import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -51,7 +50,6 @@ import com.netscape.certsrv.request.IRequestQueue; import com.netscape.certsrv.request.RequestStatus; import com.netscape.cms.servlet.base.CMSServlet; import com.netscape.cms.servlet.common.CMSRequest; -import com.netscape.cms.servlet.common.CMSTemplate; import com.netscape.cms.servlet.common.ECMSGWException; /** @@ -125,8 +123,6 @@ public class DoUnrevokeTPS extends CMSServlet { BigInteger[] serialNumbers; EBaseException error = null; - CMSTemplate form = null; - Locale[] locale = new Locale[1]; /* @@ -195,8 +191,6 @@ public class DoUnrevokeTPS extends CMSServlet { } try { - ServletOutputStream out = resp.getOutputStream(); - if (error == null) { o_status = "status=0"; errorString = "error="; @@ -530,7 +524,7 @@ public class DoUnrevokeTPS extends CMSServlet { String serialNumString = req.getParameter("serialNumber"); StringTokenizer snList = new StringTokenizer(serialNumString, " "); - Vector biList = new Vector(); + Vector<BigInteger> biList = new Vector<BigInteger>(); while (snList.hasMoreTokens()) { String snStr = snList.nextToken(); if (snStr != null) { diff --git a/pki/base/common/src/com/netscape/cms/servlet/cert/EnrollServlet.java b/pki/base/common/src/com/netscape/cms/servlet/cert/EnrollServlet.java index b580d7f79..a73a8146c 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/cert/EnrollServlet.java +++ b/pki/base/common/src/com/netscape/cms/servlet/cert/EnrollServlet.java @@ -473,7 +473,6 @@ public class EnrollServlet extends CMSServlet { (ICertRecordList) mCa.getCertificateRepository().findCertRecordsInList(filter, null, 10); int size = list.getSize(); Enumeration<ICertRecord> en = list.getCertRecords(0, size - 1); - boolean gotEncCert = false; CMS.debug("EnrollServlet: signing cert filter " + filter); @@ -989,14 +988,9 @@ public class EnrollServlet extends CMSServlet { SUBJECT_KEYGEN_INFO, null); PKCS10 pkcs10 = null; - String certType = null; - - // - String test = httpParams.getValueAsString("certNickname", null); - // support Enterprise 3.5.1 server where CERT_TYPE=csrCertType // instead of certType - certType = httpParams.getValueAsString(OLD_CERT_TYPE, null); + String certType = httpParams.getValueAsString(OLD_CERT_TYPE, null); CMS.debug("EnrollServlet: certType " + certType); if (certType == null) { diff --git a/pki/base/common/src/com/netscape/cms/servlet/cert/GetBySerial.java b/pki/base/common/src/com/netscape/cms/servlet/cert/GetBySerial.java index b9a2221f2..663397f54 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/cert/GetBySerial.java +++ b/pki/base/common/src/com/netscape/cms/servlet/cert/GetBySerial.java @@ -122,8 +122,6 @@ public class GetBySerial extends CMSServlet { * @param cmsReq the object holding the request and response information */ public void process(CMSRequest cmsReq) throws EBaseException { - int serialNumber = -1; - boolean noError = true; HttpServletRequest req = cmsReq.getHttpReq(); HttpServletResponse response = cmsReq.getHttpResp(); diff --git a/pki/base/common/src/com/netscape/cms/servlet/cert/GetCAChain.java b/pki/base/common/src/com/netscape/cms/servlet/cert/GetCAChain.java index ae7599498..fe55f335b 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/cert/GetCAChain.java +++ b/pki/base/common/src/com/netscape/cms/servlet/cert/GetCAChain.java @@ -255,7 +255,6 @@ public class GetCAChain extends CMSServlet { HttpServletResponse httpResp, CMSRequest cmsReq) throws EBaseException { - String outputString = null; CertificateChain certChain = ((ICertAuthority) mAuthority).getCACertChain(); diff --git a/pki/base/common/src/com/netscape/cms/servlet/cert/GetInfo.java b/pki/base/common/src/com/netscape/cms/servlet/cert/GetInfo.java index 9db5cb892..6af5c0c39 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/cert/GetInfo.java +++ b/pki/base/common/src/com/netscape/cms/servlet/cert/GetInfo.java @@ -314,7 +314,7 @@ public class GetInfo extends CMSServlet { if (crlSplits.length() > 0) crlSplits.append("+"); - Vector splits = ip.getSplitTimes(); + Vector<Long> splits = ip.getSplitTimes(); for (int i = 0; i < splits.size(); i++) { crlSplits.append(splits.elementAt(i)); diff --git a/pki/base/common/src/com/netscape/cms/servlet/cert/HashEnrollServlet.java b/pki/base/common/src/com/netscape/cms/servlet/cert/HashEnrollServlet.java index 4af8a6a68..5e6207e1a 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/cert/HashEnrollServlet.java +++ b/pki/base/common/src/com/netscape/cms/servlet/cert/HashEnrollServlet.java @@ -67,7 +67,6 @@ import com.netscape.certsrv.authorization.AuthzToken; import com.netscape.certsrv.base.EBaseException; import com.netscape.certsrv.base.IArgBlock; import com.netscape.certsrv.base.IConfigStore; -import com.netscape.certsrv.base.KeyGenInfo; import com.netscape.certsrv.ca.ICertificateAuthority; import com.netscape.certsrv.dbs.certdb.ICertRecord; import com.netscape.certsrv.dbs.certdb.ICertRecordList; @@ -413,18 +412,9 @@ public class HashEnrollServlet extends CMSServlet { // } } - // fill certInfo from input types: keygen, cmc, pkcs10 or crmf - KeyGenInfo keyGenInfo = - httpParams.getValueAsKeyGenInfo(SUBJECT_KEYGEN_INFO, null); - - String certType = null; - - // - String test = httpParams.getValueAsString("certNickname", null); - // support Enterprise 3.5.1 server where CERT_TYPE=csrCertType // instead of certType - certType = httpParams.getValueAsString(OLD_CERT_TYPE, null); + String certType = httpParams.getValueAsString(OLD_CERT_TYPE, null); if (certType == null) { certType = httpParams.getValueAsString(CERT_TYPE, "client"); } else { diff --git a/pki/base/common/src/com/netscape/cms/servlet/cert/RevocationServlet.java b/pki/base/common/src/com/netscape/cms/servlet/cert/RevocationServlet.java index 663eaae1a..22aa29eda 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/cert/RevocationServlet.java +++ b/pki/base/common/src/com/netscape/cms/servlet/cert/RevocationServlet.java @@ -149,7 +149,6 @@ public class RevocationServlet extends CMSServlet { BigInteger old_serial_no = null; X509CertImpl old_cert = null; - String revokeAll = null; CMSTemplate form = null; Locale[] locale = new Locale[1]; diff --git a/pki/base/common/src/com/netscape/cms/servlet/cert/UpdateCRL.java b/pki/base/common/src/com/netscape/cms/servlet/cert/UpdateCRL.java index 680886b95..c0298d1e7 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/cert/UpdateCRL.java +++ b/pki/base/common/src/com/netscape/cms/servlet/cert/UpdateCRL.java @@ -121,7 +121,6 @@ public class UpdateCRL extends CMSServlet { statsSub.startTiming("crl", true /* main action */); } - long startTime = CMS.getCurrentDate().getTime(); IAuthToken authToken = authenticate(cmsReq); AuthzToken authzToken = null; diff --git a/pki/base/common/src/com/netscape/cms/servlet/cert/scep/CRSEnrollment.java b/pki/base/common/src/com/netscape/cms/servlet/cert/scep/CRSEnrollment.java index 525775d62..90a48cb4e 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/cert/scep/CRSEnrollment.java +++ b/pki/base/common/src/com/netscape/cms/servlet/cert/scep/CRSEnrollment.java @@ -1112,7 +1112,6 @@ public class CRSEnrollment extends HttpServlet { KeyWrapper kw; Cipher cip; EncryptionAlgorithm ea; - boolean errorInRequest = false; // Unwrap the session key with the Cert server key try { diff --git a/pki/base/common/src/com/netscape/cms/servlet/common/CMCOutputTemplate.java b/pki/base/common/src/com/netscape/cms/servlet/common/CMCOutputTemplate.java index 2edfc4f08..38fcf24f9 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/common/CMCOutputTemplate.java +++ b/pki/base/common/src/com/netscape/cms/servlet/common/CMCOutputTemplate.java @@ -631,7 +631,6 @@ public class CMCOutputTemplate { IRequestQueue queue = ca.getRequestQueue(); IRequest r = queue.findRequest(new RequestId(requestId)); if (r != null) { - Integer result = r.getExtDataInInteger(IRequest.RESULT); RequestStatus status = r.getRequestStatus(); if (status.equals(RequestStatus.PENDING)) { pending_bpids.addElement(reqId); diff --git a/pki/base/common/src/com/netscape/cms/servlet/common/CMSRequest.java b/pki/base/common/src/com/netscape/cms/servlet/common/CMSRequest.java index ecc5f45be..256c01010 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/common/CMSRequest.java +++ b/pki/base/common/src/com/netscape/cms/servlet/common/CMSRequest.java @@ -252,7 +252,7 @@ public class CMSRequest { } // policy errors; set on rejection or possibly deferral. - public Vector getPolicyMessages() { + public Vector<String> getPolicyMessages() { if (mRequest != null) { return mRequest.getExtDataInStringVector(IRequest.ERRORS); } diff --git a/pki/base/common/src/com/netscape/cms/servlet/common/CMSTemplate.java b/pki/base/common/src/com/netscape/cms/servlet/common/CMSTemplate.java index 50feb0863..317bddbcd 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/common/CMSTemplate.java +++ b/pki/base/common/src/com/netscape/cms/servlet/common/CMSTemplate.java @@ -155,7 +155,6 @@ public class CMSTemplate extends CMSFile { Enumeration<String> e = null; Enumeration<IArgBlock> q = null; IArgBlock r = null; - boolean headerBlock = false, fixedBlock = false, queryBlock = false; CMSTemplateParams data = (CMSTemplateParams) input; HTTPOutputStreamWriter http_out = null; @@ -191,7 +190,6 @@ public class CMSTemplate extends CMSFile { if (r != null) { e = r.elements(); while (e.hasMoreElements()) { - headerBlock = true; String n = e.nextElement(); Object v = r.getValue(n); @@ -204,7 +202,6 @@ public class CMSTemplate extends CMSFile { if (r != null) { e = r.elements(); while (e.hasMoreElements()) { - fixedBlock = true; String n = e.nextElement(); Object v = r.getValue(n); @@ -215,7 +212,6 @@ public class CMSTemplate extends CMSFile { // Output the query data q = data.queryRecords(); if (q != null && q.hasMoreElements()) { - queryBlock = true; out.println("var recordCount = 0;"); out.println("var record;"); while (q.hasMoreElements()) { diff --git a/pki/base/common/src/com/netscape/cms/servlet/connector/CloneServlet.java b/pki/base/common/src/com/netscape/cms/servlet/connector/CloneServlet.java index 7defeeac9..f9085a5bc 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/connector/CloneServlet.java +++ b/pki/base/common/src/com/netscape/cms/servlet/connector/CloneServlet.java @@ -27,7 +27,6 @@ import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -100,8 +99,6 @@ public class CloneServlet extends CMSServlet { throw new IOException( "CMS server is not ready to serve."); - ServletContext servletContext = mConfig.getServletContext(); - CMSRequest cmsRequest = newCMSRequest(); // set argblock @@ -125,8 +122,6 @@ public class CloneServlet extends CMSServlet { int len = -1; IPKIMessage msg = null; IPKIMessage replymsg = null; - IRequest r = null; - IRequest reply = null; // NOTE must read all bufer before redoing handshake for // ssl client auth for client auth to work. @@ -310,7 +305,6 @@ public class CloneServlet extends CMSServlet { String source, String sourceUserId, IPKIMessage msg, IAuthToken token) throws EBaseException { IPKIMessage replymsg = null; - IRequest r = null; IRequestQueue queue = mAuthority.getRequestQueue(); String srcid = source + ":" + msg.getReqId(); diff --git a/pki/base/common/src/com/netscape/cms/servlet/connector/ConnectorServlet.java b/pki/base/common/src/com/netscape/cms/servlet/connector/ConnectorServlet.java index 4f708f789..e8d4f898f 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/connector/ConnectorServlet.java +++ b/pki/base/common/src/com/netscape/cms/servlet/connector/ConnectorServlet.java @@ -31,7 +31,6 @@ import java.security.cert.X509Certificate; import java.util.Enumeration; import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -135,8 +134,6 @@ public class ConnectorServlet extends CMSServlet { HttpServletRequest req = (HttpServletRequest) request; HttpServletResponse resp = (HttpServletResponse) response; - ServletContext servletContext = mConfig.getServletContext(); - CMSRequest cmsRequest = newCMSRequest(); // set argblock @@ -160,8 +157,6 @@ public class ConnectorServlet extends CMSServlet { int len = -1; IPKIMessage msg = null; IPKIMessage replymsg = null; - IRequest r = null; - IRequest reply = null; // NOTE must read all bufer before redoing handshake for // ssl client auth for client auth to work. @@ -462,7 +457,6 @@ public class ConnectorServlet extends CMSServlet { IPKIMessage replymsg = null; try { - IRequest r = null; IRequestQueue queue = mAuthority.getRequestQueue(); String srcid = source + ":" + msg.getReqId(); diff --git a/pki/base/common/src/com/netscape/cms/servlet/connector/GenerateKeyPairServlet.java b/pki/base/common/src/com/netscape/cms/servlet/connector/GenerateKeyPairServlet.java index 0a4ea589e..bb787c7ad 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/connector/GenerateKeyPairServlet.java +++ b/pki/base/common/src/com/netscape/cms/servlet/connector/GenerateKeyPairServlet.java @@ -31,7 +31,6 @@ import com.netscape.certsrv.authentication.IAuthToken; import com.netscape.certsrv.authority.IAuthority; import com.netscape.certsrv.authorization.AuthzToken; import com.netscape.certsrv.base.EBaseException; -import com.netscape.certsrv.base.IConfigStore; import com.netscape.certsrv.base.IPrettyPrintFormat; import com.netscape.certsrv.logging.ILogger; import com.netscape.certsrv.request.IRequest; @@ -110,7 +109,6 @@ public class GenerateKeyPairServlet extends CMSServlet { IRequestQueue queue = mAuthority.getRequestQueue(); IRequest thisreq = null; - IConfigStore sconfig = CMS.getConfigStore(); boolean missingParam = false; String status = "0"; @@ -147,8 +145,6 @@ public class GenerateKeyPairServlet extends CMSServlet { rArchive = "true"; } - String selectedToken = null; - if (!missingParam) { thisreq = queue.newRequest(IRequest.NETKEY_KEYGEN_REQUEST); diff --git a/pki/base/common/src/com/netscape/cms/servlet/connector/TokenKeyRecoveryServlet.java b/pki/base/common/src/com/netscape/cms/servlet/connector/TokenKeyRecoveryServlet.java index dfceddd96..337b24259 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/connector/TokenKeyRecoveryServlet.java +++ b/pki/base/common/src/com/netscape/cms/servlet/connector/TokenKeyRecoveryServlet.java @@ -33,7 +33,6 @@ import com.netscape.certsrv.authority.IAuthority; import com.netscape.certsrv.authorization.AuthzToken; import com.netscape.certsrv.base.EBaseException; import com.netscape.certsrv.base.IPrettyPrintFormat; -import com.netscape.certsrv.common.Constants; import com.netscape.certsrv.request.IRequest; import com.netscape.certsrv.request.IRequestQueue; import com.netscape.cms.servlet.base.CMSServlet; @@ -179,8 +178,6 @@ public class TokenKeyRecoveryServlet extends CMSServlet { missingParam = true; } - String selectedToken = null; - if (!missingParam) { thisreq = queue.newRequest(IRequest.NETKEY_KEYRECOVERY_REQUEST); @@ -212,7 +209,6 @@ public class TokenKeyRecoveryServlet extends CMSServlet { resp.setContentType("text/html"); - String outputString = ""; String wrappedPrivKeyString = ""; String publicKeyString = ""; String ivString = ""; @@ -327,22 +323,4 @@ public class TokenKeyRecoveryServlet extends CMSServlet { // end Netkey functions } - - /** - * XXX remember to check peer SSL cert and get RA id later - * - * Serves HTTP admin request. - * - * @param req HTTP request - * @param resp HTTP response - */ - public void service(HttpServletRequest req, HttpServletResponse resp) - throws ServletException, IOException { - String scope = req.getParameter(Constants.OP_SCOPE); - String op = req.getParameter(Constants.OP_TYPE); - - super.service(req, resp); - - } - } diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/AdminAuthenticatePanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/AdminAuthenticatePanel.java index b8cc8022e..585d444d4 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/AdminAuthenticatePanel.java +++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/AdminAuthenticatePanel.java @@ -27,8 +27,6 @@ import javax.servlet.http.HttpServletResponse; import org.apache.velocity.context.Context; import org.mozilla.jss.CryptoManager; -import org.mozilla.jss.crypto.CryptoStore; -import org.mozilla.jss.crypto.CryptoToken; import org.mozilla.jss.crypto.X509Certificate; import com.netscape.certsrv.apps.CMS; @@ -310,8 +308,7 @@ public class AdminAuthenticatePanel extends WizardPanelBase { while (st.hasMoreTokens()) { String token = st.nextToken(); String tokenname = config.getString("preop.module.token", ""); - CryptoToken tok = cm.getTokenByName(tokenname); - CryptoStore store = tok.getCryptoStore(); + cm.getTokenByName(tokenname); // throw exception on error String name1 = "preop.master." + token + ".nickname"; String nickname = config.getString(name1, ""); if (!tokenname.equals("Internal Key Storage Token") && diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/AdminPanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/AdminPanel.java index 4e73b8369..1f5a3327c 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/AdminPanel.java +++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/AdminPanel.java @@ -149,10 +149,8 @@ public class AdminPanel extends WizardPanelBase { String info = ""; context.put("import", "true"); - String subsystemtype = ""; try { type = cs.getString("preop.ca.type", ""); - subsystemtype = cs.getString("cs.type", ""); } catch (Exception e) { } @@ -254,12 +252,10 @@ public class AdminPanel extends WizardPanelBase { String type = ""; String subsystemtype = ""; - String security_domain_type = ""; String selected_hierarchy = ""; try { type = config.getString(PRE_CA_TYPE, ""); subsystemtype = config.getString("cs.type", ""); - security_domain_type = config.getString("securitydomain.select", ""); selected_hierarchy = config.getString("preop.hierarchy.select", ""); } catch (Exception e) { } @@ -277,7 +273,6 @@ public class AdminPanel extends WizardPanelBase { String name = HttpInput.getName(request, "name"); CMS.debug("AdminPanel update: email address = " + email); - String pwd = HttpInput.getPassword(request, "__pwd"); config.putString("preop.admin.uid", uid); config.putString("preop.admin.email", email); @@ -455,14 +450,6 @@ public class AdminPanel extends WizardPanelBase { private void submitRequest(String ca_hostname, int ca_port, HttpServletRequest request, HttpServletResponse response, Context context) throws IOException { IConfigStore config = CMS.getConfigStore(); - String sd_hostname = null; - int sd_port = -1; - - try { - sd_hostname = config.getString("securitydomain.host", ""); - sd_port = config.getInteger("securitydomain.httpseeport"); - } catch (Exception e) { - } String profileId = HttpInput.getID(request, "profileId"); if (profileId == null) { diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/BaseServlet.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/BaseServlet.java index f619110fd..9e800b9cc 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/BaseServlet.java +++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/BaseServlet.java @@ -60,6 +60,7 @@ public class BaseServlet extends VelocityServlet { public void outputHttpParameters(HttpServletRequest httpReq) { CMS.debug("BaseServlet:service() uri = " + httpReq.getRequestURI()); + @SuppressWarnings("unchecked") Enumeration<String> paramNames = httpReq.getParameterNames(); while (paramNames.hasMoreElements()) { diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/CAInfoPanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/CAInfoPanel.java index 5da169915..827f0ce92 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/CAInfoPanel.java +++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/CAInfoPanel.java @@ -154,7 +154,7 @@ public class CAInfoPanel extends WizardPanelBase { */ CMS.debug("CAInfoPanel: Ready to get url"); - Vector v = getUrlListFromSecurityDomain(cs, cstype, portType); + Vector<String> v = getUrlListFromSecurityDomain(cs, cstype, portType); v.addElement("External CA"); StringBuffer list = new StringBuffer(); int size = v.size(); diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/CertPrettyPrintPanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/CertPrettyPrintPanel.java index 119dead0c..9c4315c05 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/CertPrettyPrintPanel.java +++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/CertPrettyPrintPanel.java @@ -39,7 +39,7 @@ import com.netscape.cms.servlet.wizard.WizardServlet; import com.netscape.cmsutil.crypto.CryptoUtil; public class CertPrettyPrintPanel extends WizardPanelBase { - private Vector mCerts = null; + private Vector<Cert> mCerts = null; public CertPrettyPrintPanel() { } @@ -124,7 +124,7 @@ public class CertPrettyPrintPanel extends WizardPanelBase { context.put("title", "Certificates Pretty Print"); try { - mCerts = new Vector(); + mCerts = new Vector<Cert>(); IConfigStore config = CMS.getConfigStore(); diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/CertRequestPanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/CertRequestPanel.java index 04ab4dac8..20ddf9f2d 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/CertRequestPanel.java +++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/CertRequestPanel.java @@ -145,11 +145,9 @@ public class CertRequestPanel extends WizardPanelBase { public void cleanUp() throws IOException { IConfigStore cs = CMS.getConfigStore(); - String select = ""; String list = ""; String tokenname = ""; try { - select = cs.getString("preop.subsystem.select", ""); list = cs.getString("preop.cert.list", ""); tokenname = cs.getString("preop.module.token", ""); } catch (Exception e) { diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/ConfigHSMServlet.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/ConfigHSMServlet.java index ba5650542..9eb146294 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/ConfigHSMServlet.java +++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/ConfigHSMServlet.java @@ -45,7 +45,7 @@ public class ConfigHSMServlet extends ConfigBaseServlet { private static final long serialVersionUID = -330521231753992202L; private CryptoManager mCryptoManager = null; private Vector<Module> mSupportedModules = null; - private Vector mOtherModules = null; + private Vector<Module> mOtherModules = null; private String mDefaultTok = null; private Hashtable<String, PK11Module> mCurrModTable = new Hashtable<String, PK11Module>(); @@ -80,7 +80,7 @@ public class ConfigHSMServlet extends ConfigBaseServlet { public void loadOtherModules() { Enumeration<PK11Module> m = mCurrModTable.elements(); - mOtherModules = new Vector(); + mOtherModules = new Vector<Module>(); while (m.hasMoreElements()) { PK11Module mod = m.nextElement(); Enumeration<Module> s = mSupportedModules.elements(); @@ -102,7 +102,7 @@ public class ConfigHSMServlet extends ConfigBaseServlet { loadModTokens(module, mod); module.setFound(true); - mOtherModules.addElement((Object) module); + mOtherModules.addElement(module); break; } }// while diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/ConfigRootCAServlet.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/ConfigRootCAServlet.java index 44046fdcd..c9618db19 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/ConfigRootCAServlet.java +++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/ConfigRootCAServlet.java @@ -66,7 +66,7 @@ public class ConfigRootCAServlet extends ConfigBaseServlet { } } - public Vector getProfiles() { + public Vector<CertInfoProfile> getProfiles() { IConfigStore config = CMS.getConfigStore(); String instancePath = ""; @@ -75,7 +75,7 @@ public class ConfigRootCAServlet extends ConfigBaseServlet { } catch (EBaseException e) { } String p[] = { "caCert.profile" }; - Vector profiles = new Vector(); + Vector<CertInfoProfile> profiles = new Vector<CertInfoProfile>(); for (int i = 0; i < p.length; i++) { try { @@ -102,7 +102,7 @@ public class ConfigRootCAServlet extends ConfigBaseServlet { if (profile == null) { profile = "caCert.profile"; } - Vector profiles = getProfiles(); + Vector<CertInfoProfile> profiles = getProfiles(); context.put("status", "display"); context.put("profiles", profiles); @@ -122,7 +122,7 @@ public class ConfigRootCAServlet extends ConfigBaseServlet { } context.put("status", "update"); context.put("error", ""); - Vector profiles = getProfiles(); + Vector<CertInfoProfile> profiles = getProfiles(); context.put("profiles", profiles); context.put("selected_profile_id", profile); diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/CreateSubsystemPanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/CreateSubsystemPanel.java index 377043d52..9e430e2fd 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/CreateSubsystemPanel.java +++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/CreateSubsystemPanel.java @@ -100,7 +100,6 @@ public class CreateSubsystemPanel extends WizardPanelBase { } String errorString = ""; - String url = ""; if (isPanelDone()) { try { @@ -145,7 +144,7 @@ public class CreateSubsystemPanel extends WizardPanelBase { } catch (EBaseException e) { } - Vector v = getUrlListFromSecurityDomain(config, cstype, "SecurePort"); + Vector<String> v = getUrlListFromSecurityDomain(config, cstype, "SecurePort"); StringBuffer list = new StringBuffer(); int size = v.size(); diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/DisplayCertChainPanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/DisplayCertChainPanel.java index 2f5831794..c6db8a8b7 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/DisplayCertChainPanel.java +++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/DisplayCertChainPanel.java @@ -136,7 +136,7 @@ public class DisplayCertChainPanel extends WizardPanelBase { } int size = 0; - Vector v = new Vector(); + Vector<String> v = new Vector<String>(); if (!certchain_size.equals("")) { try { diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/DonePanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/DonePanel.java index 48875c4cc..663435cba 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/DonePanel.java +++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/DonePanel.java @@ -259,11 +259,9 @@ public class DonePanel extends WizardPanelBase { // update security domain String sdtype = ""; - String instanceName = ""; String subsystemName = ""; try { sdtype = cs.getString("securitydomain.select", ""); - instanceName = cs.getString("instanceId", ""); subsystemName = cs.getString("preop.subsystem.name", ""); } catch (Exception e) { } @@ -727,20 +725,15 @@ public class DonePanel extends WizardPanelBase { IConfigStore config = CMS.getConfigStore(); String cahost = ""; int caport = -1; - String sdhost = ""; - int sdport = -1; try { cahost = config.getString("preop.ca.hostname", ""); caport = config.getInteger("preop.ca.httpsport", -1); - sdhost = config.getString("securitydomain.host", ""); - sdport = config.getInteger("securitydomain.httpseeport", -1); } catch (Exception e) { } String ocsphost = CMS.getAgentHost(); int ocspport = Integer.parseInt(CMS.getAgentPort()); - int ocspagentport = Integer.parseInt(CMS.getAgentPort()); String session_id = CMS.getConfigSDSessionId(); String content = "xmlOutput=true&sessionID=" + session_id + "&ocsp_host=" + ocsphost + "&ocsp_port=" + ocspport; diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/GetCookie.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/GetCookie.java index 8575658ea..e6810ff42 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/GetCookie.java +++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/GetCookie.java @@ -93,12 +93,7 @@ public class GetCookie extends CMSServlet { CMS.debug("GetCookie start"); IAuthToken authToken = null; - int sessionMaxAge = SESSION_MAX_AGE; IConfigStore cs = CMS.getConfigStore(); - try { - sessionMaxAge = cs.getInteger("sessionMaxAge", SESSION_MAX_AGE); - } catch (Exception e) { - } IArgBlock header = CMS.createArgBlock(); IArgBlock ctx = CMS.createArgBlock(); diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/ImportAdminCertPanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/ImportAdminCertPanel.java index 36ced4879..93c26cdf3 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/ImportAdminCertPanel.java +++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/ImportAdminCertPanel.java @@ -97,11 +97,9 @@ public class ImportAdminCertPanel extends WizardPanelBase { IConfigStore cs = CMS.getConfigStore(); String type = ""; - String subsystemtype = ""; try { type = cs.getString("preop.ca.type", ""); - subsystemtype = cs.getString("cs.type", ""); } catch (Exception e) { } @@ -188,13 +186,11 @@ public class ImportAdminCertPanel extends WizardPanelBase { String type = ""; String subsystemtype = ""; - String security_domain_type = ""; String selected_hierarchy = ""; try { type = cs.getString("preop.ca.type", ""); subsystemtype = cs.getString("cs.type", ""); - security_domain_type = cs.getString("securitydomain.select", ""); selected_hierarchy = cs.getString("preop.hierarchy.select", ""); } catch (Exception e) { } diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/ImportTransportCert.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/ImportTransportCert.java index 3b8f3b81f..66ca8a8bf 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/ImportTransportCert.java +++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/ImportTransportCert.java @@ -122,7 +122,6 @@ public class ImportTransportCert extends CMSServlet { IConfigStore cs = CMS.getConfigStore(); - String name = httpReq.getParameter("name"); String certsString = httpReq.getParameter("certificate"); try { diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/NamePanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/NamePanel.java index f0447170e..916ab199b 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/NamePanel.java +++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/NamePanel.java @@ -287,7 +287,7 @@ public class NamePanel extends WizardPanelBase { } CMS.debug("NamePanel: Ready to get SSL EE HTTPS urls"); - Vector v = getUrlListFromSecurityDomain(config, "CA", "SecurePort"); + Vector<String> v = getUrlListFromSecurityDomain(config, "CA", "SecurePort"); v.addElement("External CA"); StringBuffer list = new StringBuffer(); int size = v.size(); @@ -782,14 +782,12 @@ public class NamePanel extends WizardPanelBase { //if no hselect, then not CA if (hselect.equals("") || hselect.equals("join")) { - String select = null; String url = getURL(request, config); URL urlx = null; if (url.equals("External CA")) { CMS.debug("NamePanel: external CA selected"); - select = "otherca"; config.putString("preop.ca.type", "otherca"); if (subsystem != null) { config.putString(PCERT_PREFIX + "signing.type", "remote"); @@ -801,7 +799,6 @@ public class NamePanel extends WizardPanelBase { CMS.debug("NamePanel: update: this is the external CA."); } else { CMS.debug("NamePanel: local CA selected"); - select = "sdca"; // parse URL (CA1 - https://...) url = url.substring(url.indexOf("https")); config.putString("preop.ca.url", url); @@ -833,7 +830,6 @@ public class NamePanel extends WizardPanelBase { while (c.hasMoreElements()) { Cert cert = c.nextElement(); String ct = cert.getCertTag(); - String tokenname = cert.getTokenname(); boolean enable = config.getBoolean(PCERT_PREFIX + ct + ".enable", true); if (!enable) continue; diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/RestoreKeyCertPanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/RestoreKeyCertPanel.java index ea0e79787..54a5ed3f6 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/RestoreKeyCertPanel.java +++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/RestoreKeyCertPanel.java @@ -165,7 +165,6 @@ public class RestoreKeyCertPanel extends WizardPanelBase { try { String s = config.getString("preop.pk12.path", ""); - String type = config.getString("preop.subsystem.select", ""); context.put("path", s); } catch (Exception e) { CMS.debug(e.toString()); @@ -265,8 +264,8 @@ public class RestoreKeyCertPanel extends WizardPanelBase { if (verifypfx) { CMS.debug("RestoreKeyCertPanel verify the PFX."); AuthenticatedSafes safes = pfx.getAuthSafes(); - Vector pkeyinfo_collection = new Vector(); - Vector cert_collection = new Vector(); + Vector<Vector<Object>> pkeyinfo_collection = new Vector<Vector<Object>>(); + Vector<Vector<Object>> cert_collection = new Vector<Vector<Object>>(); for (int i = 0; i < safes.getSize(); i++) { try { SEQUENCE scontent = safes.getSafeContentsAt(null, i); @@ -276,9 +275,8 @@ public class RestoreKeyCertPanel extends WizardPanelBase { if (oid.equals(SafeBag.PKCS8_SHROUDED_KEY_BAG)) { EncryptedPrivateKeyInfo privkeyinfo = (EncryptedPrivateKeyInfo) bag.getInterpretedBagContent(); - PasswordConverter passConverter = new PasswordConverter(); PrivateKeyInfo pkeyinfo = privkeyinfo.decrypt(password, new PasswordConverter()); - Vector pkeyinfo_v = new Vector(); + Vector<Object> pkeyinfo_v = new Vector<Object>(); pkeyinfo_v.addElement(pkeyinfo); SET bagAttrs = bag.getBagAttributes(); for (int k = 0; k < bagAttrs.size(); k++) { @@ -288,7 +286,7 @@ public class RestoreKeyCertPanel extends WizardPanelBase { SET val = attrs.getValues(); ANY ss = (ANY) val.elementAt(0); ByteArrayInputStream bbis = new ByteArrayInputStream(ss.getEncoded()); - BMPString sss = (BMPString) (new BMPString.Template()).decode(bbis); + BMPString sss = (BMPString) new BMPString.Template().decode(bbis); String s = sss.toString(); pkeyinfo_v.addElement(s); } @@ -298,7 +296,7 @@ public class RestoreKeyCertPanel extends WizardPanelBase { CertBag cbag = (CertBag) bag.getInterpretedBagContent(); OCTET_STRING str = (OCTET_STRING) cbag.getInterpretedCert(); byte[] x509cert = str.toByteArray(); - Vector cert_v = new Vector(); + Vector<Object> cert_v = new Vector<Object>(); cert_v.addElement(x509cert); SET bagAttrs = bag.getBagAttributes(); @@ -374,14 +372,10 @@ public class RestoreKeyCertPanel extends WizardPanelBase { cstype = toLowerCaseSubsystemType(cstype); String session_id = CMS.getConfigSDSessionId(); - String sd_hostname = ""; - int sd_port = -1; String master_hostname = ""; int master_port = -1; int master_ee_port = -1; try { - sd_hostname = config.getString("securitydomain.host", ""); - sd_port = config.getInteger("securitydomain.httpsadminport", -1); master_hostname = config.getString("preop.master.hostname", ""); master_port = config.getInteger("preop.master.httpsadminport", -1); master_ee_port = config.getInteger("preop.master.httpsport", -1); @@ -527,8 +521,8 @@ public class RestoreKeyCertPanel extends WizardPanelBase { return org.mozilla.jss.crypto.PrivateKey.Type.RSA; } - private void importkeycert(Vector pkeyinfo_collection, - Vector cert_collection) throws IOException { + private void importkeycert(Vector<Vector<Object>> pkeyinfo_collection, + Vector<Vector<Object>> cert_collection) throws IOException { CryptoManager cm = null; try { cm = CryptoManager.getInstance(); @@ -540,7 +534,7 @@ public class RestoreKeyCertPanel extends WizardPanelBase { for (int i = 0; i < pkeyinfo_collection.size(); i++) { try { - Vector pkeyinfo_v = (Vector) pkeyinfo_collection.elementAt(i); + Vector<Object> pkeyinfo_v = pkeyinfo_collection.elementAt(i); PrivateKeyInfo pkeyinfo = (PrivateKeyInfo) pkeyinfo_v.elementAt(0); String nickname = (String) pkeyinfo_v.elementAt(1); byte[] x509cert = getX509Cert(nickname, cert_collection); @@ -569,8 +563,7 @@ public class RestoreKeyCertPanel extends WizardPanelBase { KeyWrapper wrapper = token.getKeyWrapper(KeyWrapAlgorithm.DES3_CBC_PAD); wrapper.initUnwrap(sk, param); - org.mozilla.jss.crypto.PrivateKey pp = - wrapper.unwrapPrivate(encpkey, getPrivateKeyType(publickey), publickey); + wrapper.unwrapPrivate(encpkey, getPrivateKeyType(publickey), publickey); } catch (Exception e) { CMS.debug("RestoreKeyCertPanel importkeycert: Exception=" + e.toString()); @@ -579,7 +572,7 @@ public class RestoreKeyCertPanel extends WizardPanelBase { for (int i = 0; i < cert_collection.size(); i++) { try { - Vector cert_v = (Vector) cert_collection.elementAt(i); + Vector<Object> cert_v = cert_collection.elementAt(i); byte[] cert = (byte[]) cert_v.elementAt(0); if (cert_v.size() > 1) { String name = (String) cert_v.elementAt(1); @@ -658,10 +651,10 @@ public class RestoreKeyCertPanel extends WizardPanelBase { return null; } - private byte[] getX509Cert(String nickname, Vector cert_collection) + private byte[] getX509Cert(String nickname, Vector<Vector<Object>> cert_collection) throws IOException { for (int i = 0; i < cert_collection.size(); i++) { - Vector v = (Vector) cert_collection.elementAt(i); + Vector<Object> v = cert_collection.elementAt(i); byte[] b = (byte[]) v.elementAt(0); X509CertImpl impl = null; try { @@ -703,8 +696,7 @@ public class RestoreKeyCertPanel extends WizardPanelBase { if (token.equals("sslserver")) continue; String tokenname = config.getString("preop.module.token", ""); - CryptoToken tok = cm.getTokenByName(tokenname); - CryptoStore store = tok.getCryptoStore(); + cm.getTokenByName(tokenname); // throw exception if token doesn't exist String name1 = "preop.master." + token + ".nickname"; String nickname = config.getString(name1, ""); if (!tokenname.equals("Internal Key Storage Token") && diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/WizardPanelBase.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/WizardPanelBase.java index ea47e82ed..55f7171ef 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/WizardPanelBase.java +++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/WizardPanelBase.java @@ -739,7 +739,6 @@ public class WizardPanelBase implements IWizardPanel { cs.putString("preop.cookie", cookie); return true; } else { - String error = parser.getValue("Error"); return false; } } catch (Exception e) { @@ -990,15 +989,15 @@ public class WizardPanelBase implements IWizardPanel { int len = nodeList.getLength(); for (int i = 0; i < len; i++) { - Vector v_hostname = + Vector<String> v_hostname = parser.getValuesFromContainer(nodeList.item(i), "Host"); - Vector v_https_admin_port = + Vector<String> v_https_admin_port = parser.getValuesFromContainer(nodeList.item(i), "SecureAdminPort"); - Vector v_domain_mgr = + Vector<String> v_domain_mgr = parser.getValuesFromContainer(nodeList.item(i), "DomainManager"); @@ -1014,10 +1013,10 @@ public class WizardPanelBase implements IWizardPanel { return dm.equalsIgnoreCase("true"); } - public Vector getMasterUrlListFromSecurityDomain(IConfigStore config, + public Vector<String> getMasterUrlListFromSecurityDomain(IConfigStore config, String type, String portType) { - Vector v = new Vector(); + Vector<String> v = new Vector<String>(); try { String hostname = config.getString("securitydomain.host"); @@ -1025,18 +1024,8 @@ public class WizardPanelBase implements IWizardPanel { CMS.debug("Getting domain.xml from CA..."); String c = getDomainXML(hostname, httpsadminport, true); - String list = ""; CMS.debug("Type " + type); - if (type.equals("CA")) { - list = "CAList"; - } else if (type.equals("KRA")) { - list = "KRAList"; - } else if (type.equals("OCSP")) { - list = "OCSPList"; - } else if (type.equals("TKS")) { - list = "TKSList"; - } CMS.debug("Getting " + portType + " from Security Domain ..."); if (!portType.equals("UnSecurePort") && @@ -1061,16 +1050,16 @@ public class WizardPanelBase implements IWizardPanel { CMS.debug("Len " + len); for (int i = 0; i < len; i++) { - Vector v_clone = parser.getValuesFromContainer(nodeList.item(i), + Vector<String> v_clone = parser.getValuesFromContainer(nodeList.item(i), "Clone"); String clone = (String) v_clone.elementAt(0); if (clone.equalsIgnoreCase("true")) continue; - Vector v_name = parser.getValuesFromContainer(nodeList.item(i), + Vector<String> v_name = parser.getValuesFromContainer(nodeList.item(i), "SubsystemName"); - Vector v_host = parser.getValuesFromContainer(nodeList.item(i), + Vector<String> v_host = parser.getValuesFromContainer(nodeList.item(i), "Host"); - Vector v_port = parser.getValuesFromContainer(nodeList.item(i), + Vector<String> v_port = parser.getValuesFromContainer(nodeList.item(i), portType); v.addElement(v_name.elementAt(0) @@ -1179,15 +1168,15 @@ public class WizardPanelBase implements IWizardPanel { int len = nodeList.getLength(); for (int i = 0; i < len; i++) { - Vector v_hostname = + Vector<String> v_hostname = parser.getValuesFromContainer(nodeList.item(i), "Host"); - Vector v_https_ee_port = + Vector<String> v_https_ee_port = parser.getValuesFromContainer(nodeList.item(i), "SecurePort"); - Vector v_https_admin_port = + Vector<String> v_https_admin_port = parser.getValuesFromContainer(nodeList.item(i), "SecureAdminPort"); @@ -1234,11 +1223,11 @@ public class WizardPanelBase implements IWizardPanel { int len = nodeList.getLength(); for (int i = 0; i < len; i++) { - Vector v_admin_port = + Vector<String> v_admin_port = parser.getValuesFromContainer(nodeList.item(i), "SecureAdminPort"); - Vector v_port = null; + Vector<String> v_port = null; if (portType.equals("UnSecurePort")) { v_port = parser.getValuesFromContainer(nodeList.item(i), "UnSecurePort"); diff --git a/pki/base/common/src/com/netscape/cms/servlet/key/DisplayTransport.java b/pki/base/common/src/com/netscape/cms/servlet/key/DisplayTransport.java index a86a676b0..dd224cc8a 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/key/DisplayTransport.java +++ b/pki/base/common/src/com/netscape/cms/servlet/key/DisplayTransport.java @@ -19,7 +19,6 @@ package com.netscape.cms.servlet.key; import javax.servlet.ServletConfig; import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.netscape.certsrv.apps.CMS; @@ -76,7 +75,6 @@ public class DisplayTransport extends CMSServlet { */ public void process(CMSRequest cmsReq) throws EBaseException { - HttpServletRequest req = cmsReq.getHttpReq(); HttpServletResponse resp = cmsReq.getHttpResp(); IAuthToken authToken = authenticate(cmsReq); diff --git a/pki/base/common/src/com/netscape/cms/servlet/key/ExamineRecovery.java b/pki/base/common/src/com/netscape/cms/servlet/key/ExamineRecovery.java index 81ced5290..cd440da08 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/key/ExamineRecovery.java +++ b/pki/base/common/src/com/netscape/cms/servlet/key/ExamineRecovery.java @@ -151,7 +151,6 @@ public class ExamineRecovery extends CMSServlet { IArgBlock header = CMS.createArgBlock(); IArgBlock fixed = CMS.createArgBlock(); CMSTemplateParams argSet = new CMSTemplateParams(header, fixed); - int seq = -1; EBaseException error = null; diff --git a/pki/base/common/src/com/netscape/cms/servlet/key/GetApprovalStatus.java b/pki/base/common/src/com/netscape/cms/servlet/key/GetApprovalStatus.java index 0019c9508..55d79b1ab 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/key/GetApprovalStatus.java +++ b/pki/base/common/src/com/netscape/cms/servlet/key/GetApprovalStatus.java @@ -133,7 +133,6 @@ public class GetApprovalStatus extends CMSServlet { IArgBlock header = CMS.createArgBlock(); IArgBlock fixed = CMS.createArgBlock(); CMSTemplateParams argSet = new CMSTemplateParams(header, fixed); - int seq = -1; int rComplete = 0; // get status and populate argSet diff --git a/pki/base/common/src/com/netscape/cms/servlet/key/GetAsyncPk12.java b/pki/base/common/src/com/netscape/cms/servlet/key/GetAsyncPk12.java index 4a9628386..9d67cab8d 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/key/GetAsyncPk12.java +++ b/pki/base/common/src/com/netscape/cms/servlet/key/GetAsyncPk12.java @@ -155,7 +155,6 @@ public class GetAsyncPk12 extends CMSServlet { IArgBlock header = CMS.createArgBlock(); IArgBlock fixed = CMS.createArgBlock(); CMSTemplateParams argSet = new CMSTemplateParams(header, fixed); - int seq = -1; // get status and populate argSet try { diff --git a/pki/base/common/src/com/netscape/cms/servlet/key/GrantAsyncRecovery.java b/pki/base/common/src/com/netscape/cms/servlet/key/GrantAsyncRecovery.java index a40edee80..7c0c0cb1c 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/key/GrantAsyncRecovery.java +++ b/pki/base/common/src/com/netscape/cms/servlet/key/GrantAsyncRecovery.java @@ -154,8 +154,6 @@ public class GrantAsyncRecovery extends CMSServlet { IArgBlock fixed = CMS.createArgBlock(); CMSTemplateParams argSet = new CMSTemplateParams(header, fixed); - int seq = -1; - String agentID = authToken.getInString("uid"); CMS.debug("GrantAsyncRecovery: process() agent uid=" + agentID); CMS.debug("GrantAsyncRecovery: process() request id=" + req.getParameter("reqID")); diff --git a/pki/base/common/src/com/netscape/cms/servlet/key/GrantRecovery.java b/pki/base/common/src/com/netscape/cms/servlet/key/GrantRecovery.java index 9989fafad..02aacc31c 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/key/GrantRecovery.java +++ b/pki/base/common/src/com/netscape/cms/servlet/key/GrantRecovery.java @@ -157,8 +157,6 @@ public class GrantRecovery extends CMSServlet { IArgBlock fixed = CMS.createArgBlock(); CMSTemplateParams argSet = new CMSTemplateParams(header, fixed); - int seq = -1; - String agentID = authToken.getInString("uid"); if (CMS.getConfigStore().getBoolean("kra.keySplitting")) { agentID = req.getParameter("agentID"); diff --git a/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileSubmitServlet.java b/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileSubmitServlet.java index 0bb038677..eb3b93eb8 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileSubmitServlet.java +++ b/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileSubmitServlet.java @@ -477,7 +477,6 @@ public class ProfileSubmitServlet extends ProfileServlet { statsSub.startTiming("enrollment", true /* main action */); } - long startTime = CMS.getCurrentDate().getTime(); Locale locale = getLocale(request); ArgSet args = new ArgSet(); @@ -750,8 +749,8 @@ public class ProfileSubmitServlet extends ProfileServlet { if (origReq != null) { CMS.debug("ProfileSubmitServlet: renewal: found original enrollment request id:" + rid); // debug: print the extData keys - Enumeration<String> en = origReq.getExtDataKeys(); /* + Enumeration<String> en = origReq.getExtDataKeys(); CMS.debug("ProfileSubmitServlet: renewal: origRequest extdata key print BEGINS"); while (en.hasMoreElements()) { String next = (String) en.nextElement(); diff --git a/pki/base/common/src/com/netscape/cms/servlet/request/CheckRequest.java b/pki/base/common/src/com/netscape/cms/servlet/request/CheckRequest.java index 1d04952d1..b65c90fca 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/request/CheckRequest.java +++ b/pki/base/common/src/com/netscape/cms/servlet/request/CheckRequest.java @@ -148,7 +148,7 @@ public class CheckRequest extends CMSServlet { */ public void process(CMSRequest cmsReq) throws EBaseException { CMS.debug("checkRequest: in process!"); - SET transIds = null, rNonces = null, sNonces = null; + SET transIds = null, sNonces = null; boolean isCMCReq = false; INTEGER bodyPartId = null; @@ -252,7 +252,7 @@ public class CheckRequest extends CMSServlet { } else if (type.equals(OBJECT_IDENTIFIER.id_cmc_transactionId)) { transIds = taggedAttr.getValues(); } else if (type.equals(OBJECT_IDENTIFIER.id_cmc_recipientNonce)) { - rNonces = taggedAttr.getValues(); + // recipient nonce } else if (type.equals(OBJECT_IDENTIFIER.id_cmc_senderNonce)) { sNonces = taggedAttr.getValues(); } diff --git a/pki/base/common/src/com/netscape/cms/servlet/request/ProcessCertReq.java b/pki/base/common/src/com/netscape/cms/servlet/request/ProcessCertReq.java index ee5581a6d..820e9a654 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/request/ProcessCertReq.java +++ b/pki/base/common/src/com/netscape/cms/servlet/request/ProcessCertReq.java @@ -275,7 +275,7 @@ public class ProcessCertReq extends CMSServlet { IArgBlock fixed = CMS.createArgBlock(); CMSTemplateParams argSet = new CMSTemplateParams(header, fixed); - CMSTemplate form = null, errorForm = null; + CMSTemplate form = null; Locale[] locale = new Locale[1]; try { @@ -342,7 +342,6 @@ public class ProcessCertReq extends CMSServlet { if (xmlOutput != null && xmlOutput.equals("true")) { outputXML(resp, argSet); } else { - String output = form.getOutput(argSet); resp.setContentType("text/html"); form.renderOutput(out, argSet); cmsReq.setStatus(CMSRequest.SUCCESS); @@ -1002,19 +1001,15 @@ public class ProcessCertReq extends CMSServlet { } // grant trusted manager or agent privileges - Object grantError = null; - try { int res = grant_privileges( cmsReq, r, issuedCerts, header); if (res != 0) { header.addStringValue(GRANT_ERROR, "SUCCESS"); - grantError = "SUCCESS"; } } catch (EBaseException e) { header.addStringValue(GRANT_ERROR, e.toString()); - grantError = e; } // if this is a RA, show the certificate right away diff --git a/pki/base/common/src/com/netscape/cms/servlet/request/ProcessReq.java b/pki/base/common/src/com/netscape/cms/servlet/request/ProcessReq.java index a4eb68b19..9c173d832 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/request/ProcessReq.java +++ b/pki/base/common/src/com/netscape/cms/servlet/request/ProcessReq.java @@ -145,7 +145,7 @@ public class ProcessReq extends CMSServlet { String doAssign = null; EBaseException error = null; - CMSTemplate form = null, errorForm = null; + CMSTemplate form = null; Locale[] locale = new Locale[1]; try { @@ -214,7 +214,6 @@ public class ProcessReq extends CMSServlet { if (xmlOutput != null && xmlOutput.equals("true")) { outputXML(resp, argSet); } else { - String output = form.getOutput(argSet); resp.setContentType("text/html"); form.renderOutput(out, argSet); cmsReq.setStatus(CMSRequest.SUCCESS); diff --git a/pki/base/common/src/com/netscape/cms/servlet/request/QueryReq.java b/pki/base/common/src/com/netscape/cms/servlet/request/QueryReq.java index 181f9f906..f6ae634f4 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/request/QueryReq.java +++ b/pki/base/common/src/com/netscape/cms/servlet/request/QueryReq.java @@ -435,8 +435,6 @@ public class QueryReq extends CMSServlet { header.addIntegerValue(OUT_TOTALCOUNT, totalCount); header.addIntegerValue(OUT_CURRENTCOUNT, list.getSize()); - int numEntries = list.getSize() - list.getCurrentIndex(); - Vector<IRequest> v = fetchRecords(list, maxCount); v = normalizeOrder(v); trim(v, id); diff --git a/pki/base/common/src/com/netscape/cms/servlet/request/SearchReqs.java b/pki/base/common/src/com/netscape/cms/servlet/request/SearchReqs.java index 5fc05bb25..08d5805b6 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/request/SearchReqs.java +++ b/pki/base/common/src/com/netscape/cms/servlet/request/SearchReqs.java @@ -182,7 +182,6 @@ public class SearchReqs extends CMSServlet { return; } - String revokeAll = null; EBaseException error = null; int maxResults = -1; int timeLimit = -1; diff --git a/pki/base/common/src/com/netscape/cms/servlet/wizard/WizardServlet.java b/pki/base/common/src/com/netscape/cms/servlet/wizard/WizardServlet.java index a71f26dcf..42fa88cd9 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/wizard/WizardServlet.java +++ b/pki/base/common/src/com/netscape/cms/servlet/wizard/WizardServlet.java @@ -418,6 +418,7 @@ public class WizardServlet extends VelocityServlet { public void outputHttpParameters(HttpServletRequest httpReq) { CMS.debug("WizardServlet:service() uri = " + httpReq.getRequestURI()); + @SuppressWarnings("unchecked") Enumeration<String> paramNames = httpReq.getParameterNames(); while (paramNames.hasMoreElements()) { String pn = paramNames.nextElement(); diff --git a/pki/base/common/src/com/netscape/cmscore/authentication/ChallengePhraseAuthentication.java b/pki/base/common/src/com/netscape/cmscore/authentication/ChallengePhraseAuthentication.java index 1c4d9fbcf..a7d5329c0 100644 --- a/pki/base/common/src/com/netscape/cmscore/authentication/ChallengePhraseAuthentication.java +++ b/pki/base/common/src/com/netscape/cmscore/authentication/ChallengePhraseAuthentication.java @@ -20,7 +20,6 @@ package com.netscape.cmscore.authentication; import java.math.BigInteger; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; -import java.util.Vector; import com.netscape.certsrv.apps.CMS; import com.netscape.certsrv.authentication.AuthToken; @@ -80,7 +79,6 @@ public class ChallengePhraseAuthentication implements IAuthManager { private ICertUserLocator mCULocator = null; private ILogger mLogger = CMS.getLogger(); private String mRequestor = null; - private Vector mID = null; private MessageDigest mSHADigest = null; // request attributes hacks diff --git a/pki/base/common/src/com/netscape/cmscore/authorization/AuthzSubsystem.java b/pki/base/common/src/com/netscape/cmscore/authorization/AuthzSubsystem.java index 1a1aaa634..16bc40e29 100644 --- a/pki/base/common/src/com/netscape/cmscore/authorization/AuthzSubsystem.java +++ b/pki/base/common/src/com/netscape/cmscore/authorization/AuthzSubsystem.java @@ -421,9 +421,8 @@ public class AuthzSubsystem implements IAuthzSubsystem { IAuthzManager mgr = (IAuthzManager) get((String) e.nextElement()); - String infoMsg = - "Shutting down authz manager instance " + mgr.getName(); - + //String infoMsg = + // "Shutting down authz manager instance " + mgr.getName(); //log(ILogger.LL_INFO, infoMsg); mgr.shutdown(); diff --git a/pki/base/common/src/com/netscape/cmscore/base/SubsystemLoader.java b/pki/base/common/src/com/netscape/cmscore/base/SubsystemLoader.java index 0dbeb4b51..a9307e858 100644 --- a/pki/base/common/src/com/netscape/cmscore/base/SubsystemLoader.java +++ b/pki/base/common/src/com/netscape/cmscore/base/SubsystemLoader.java @@ -37,8 +37,8 @@ public class SubsystemLoader { private static final String PROP_CLASSNAME = "class"; private static final String PROP_ID = "id"; - public static Vector load(IConfigStore config) throws EBaseException { - Vector v = new Vector(); + public static Vector<ISubsystem> load(IConfigStore config) throws EBaseException { + Vector<ISubsystem> v = new Vector<ISubsystem>(); // load a list of installable subsystems (services) for (int i = 0;; i++) { diff --git a/pki/base/common/src/com/netscape/cmscore/connector/HttpConnector.java b/pki/base/common/src/com/netscape/cmscore/connector/HttpConnector.java index 8a05c1c74..cdb315795 100644 --- a/pki/base/common/src/com/netscape/cmscore/connector/HttpConnector.java +++ b/pki/base/common/src/com/netscape/cmscore/connector/HttpConnector.java @@ -170,7 +170,7 @@ public class HttpConnector implements IConnector { r.setExtData(IRequest.ERROR, new EBaseException(CMS.getUserMessage("CMS_BASE_REMOTE_AUTHORITY_ERROR"))); // XXX overload svcerrors for now. - Vector policyErrors = r.getExtDataInStringVector(IRequest.ERRORS); + Vector<String> policyErrors = r.getExtDataInStringVector(IRequest.ERRORS); if (policyErrors != null && policyErrors.size() > 0) { r.setExtData(IRequest.SVCERRORS, policyErrors); diff --git a/pki/base/common/src/com/netscape/cmscore/connector/HttpPKIMessage.java b/pki/base/common/src/com/netscape/cmscore/connector/HttpPKIMessage.java index d7024f4ad..ea235391d 100644 --- a/pki/base/common/src/com/netscape/cmscore/connector/HttpPKIMessage.java +++ b/pki/base/common/src/com/netscape/cmscore/connector/HttpPKIMessage.java @@ -103,7 +103,6 @@ public class HttpPKIMessage implements IHttpPKIMessage { reqStatus = r.getRequestStatus().toString(); CMS.debug("HttpPKMessage.toRequest: requestStatus=" + reqStatus); - int len = RequestTransfer.getTransferAttributes(r).length; String key; Object value; Enumeration<Object> enum1 = mNameVals.elements(); diff --git a/pki/base/common/src/com/netscape/cmscore/crmf/CRMFParser.java b/pki/base/common/src/com/netscape/cmscore/crmf/CRMFParser.java index 962b02a9d..b42bc00f9 100644 --- a/pki/base/common/src/com/netscape/cmscore/crmf/CRMFParser.java +++ b/pki/base/common/src/com/netscape/cmscore/crmf/CRMFParser.java @@ -48,7 +48,7 @@ public class CRMFParser { */ public static PKIArchiveOptionsContainer[] getPKIArchiveOptions(String crmfBlob) throws IOException { - Vector options = new Vector(); + Vector<PKIArchiveOptionsContainer> options = new Vector<PKIArchiveOptionsContainer>(); byte[] crmfBerBlob = null; diff --git a/pki/base/common/src/com/netscape/cmscore/dbs/CRLRepository.java b/pki/base/common/src/com/netscape/cmscore/dbs/CRLRepository.java index f9c4369a2..7eb470d55 100644 --- a/pki/base/common/src/com/netscape/cmscore/dbs/CRLRepository.java +++ b/pki/base/common/src/com/netscape/cmscore/dbs/CRLRepository.java @@ -27,7 +27,6 @@ import netscape.security.x509.RevokedCertificate; import com.netscape.certsrv.apps.CMS; import com.netscape.certsrv.base.EBaseException; 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; @@ -59,26 +58,24 @@ public class CRLRepository extends Repository implements ICRLRepository { mBaseDN = baseDN; mDBService = dbService; - IDBRegistry reg = dbService.getRegistry(); - - /** - * String crlRecordOC[] = new String[1]; - * crlRecordOC[0] = Schema.LDAP_OC_CRL_RECORD; - * reg.registerObjectClass(CRLIssuingPointRecord.class.getName(), - * crlRecordOC); - * reg.registerAttribute(ICRLIssuingPointRecord.ATTR_ID, new - * StringMapper(Schema.LDAP_ATTR_CRL_ID)); - * reg.registerAttribute(ICRLIssuingPointRecord.ATTR_CRL_NUMBER, new - * BigIntegerMapper(Schema.LDAP_ATTR_CRL_NUMBER)); - * reg.registerAttribute(ICRLIssuingPointRecord.ATTR_CRL_SIZE, new - * LongMapper(Schema.LDAP_ATTR_CRL_SIZE)); - * reg.registerAttribute(ICRLIssuingPointRecord.ATTR_THIS_UPDATE, new - * DateMapper(Schema.LDAP_ATTR_THIS_UPDATE)); - * reg.registerAttribute(ICRLIssuingPointRecord.ATTR_NEXT_UPDATE, new - * DateMapper(Schema.LDAP_ATTR_NEXT_UPDATE)); - * reg.registerAttribute(ICRLIssuingPointRecord.ATTR_CRL, new - * ByteArrayMapper(Schema.LDAP_ATTR_CRL)); - **/ + /* + DBRegistry reg = dbService.getRegistry(); + String crlRecordOC[] = new String[1]; + crlRecordOC[0] = Schema.LDAP_OC_CRL_RECORD; + reg.registerObjectClass(CRLIssuingPointRecord.class.getName(), crlRecordOC); + reg.registerAttribute(ICRLIssuingPointRecord.ATTR_ID, + new StringMapper(Schema.LDAP_ATTR_CRL_ID)); + reg.registerAttribute(ICRLIssuingPointRecord.ATTR_CRL_NUMBER, + new BigIntegerMapper(Schema.LDAP_ATTR_CRL_NUMBER)); + reg.registerAttribute(ICRLIssuingPointRecord.ATTR_CRL_SIZE, + new LongMapper(Schema.LDAP_ATTR_CRL_SIZE)); + reg.registerAttribute(ICRLIssuingPointRecord.ATTR_THIS_UPDATE, + new DateMapper(Schema.LDAP_ATTR_THIS_UPDATE)); + reg.registerAttribute(ICRLIssuingPointRecord.ATTR_NEXT_UPDATE, + new DateMapper(Schema.LDAP_ATTR_NEXT_UPDATE)); + reg.registerAttribute(ICRLIssuingPointRecord.ATTR_CRL, + new ByteArrayMapper(Schema.LDAP_ATTR_CRL)); + */ } /** 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 ae77330fc..0df563cad 100644 --- a/pki/base/common/src/com/netscape/cmscore/dbs/CertificateRepository.java +++ b/pki/base/common/src/com/netscape/cmscore/dbs/CertificateRepository.java @@ -1535,8 +1535,6 @@ public class CertificateRepository extends Repository public ICertRecordList getInvalidCertsByNotBeforeDate(Date date, int pageSize) throws EBaseException { - Date rightNow = CMS.getCurrentDate(); - ICertRecordList list = null; IDBSSession s = mDBService.createSession(); diff --git a/pki/base/common/src/com/netscape/cmscore/dbs/DBSSession.java b/pki/base/common/src/com/netscape/cmscore/dbs/DBSSession.java index 7201f61e7..ddc9f1874 100644 --- a/pki/base/common/src/com/netscape/cmscore/dbs/DBSSession.java +++ b/pki/base/common/src/com/netscape/cmscore/dbs/DBSSession.java @@ -263,6 +263,7 @@ public class DBSSession implements IDBSSession { return search(base, filter, null); } + @SuppressWarnings("unchecked") public IDBSearchResults search(String base, String filter, int maxSize) throws EBaseException { try { @@ -290,6 +291,7 @@ public class DBSSession implements IDBSSession { } } + @SuppressWarnings("unchecked") public IDBSearchResults search(String base, String filter, int maxSize, int timeLimit) throws EBaseException { try { @@ -322,6 +324,7 @@ public class DBSSession implements IDBSSession { * Retrieves a list of object that satifies the given * filter. */ + @SuppressWarnings("unchecked") public IDBSearchResults search(String base, String filter, String attrs[]) throws EBaseException { try { @@ -458,13 +461,13 @@ public class DBSSession implements IDBSSession { /** * Retrieves a list of objects. */ - public IDBVirtualList<?> createVirtualList(String base, String filter, + public IDBVirtualList<Object> createVirtualList(String base, String filter, String attrs[], String sortKey, int pageSize) throws EBaseException { return new DBVirtualList<Object>(mDBSystem.getRegistry(), mConn, base, filter, attrs, sortKey, pageSize); } - public IDBVirtualList<?> createVirtualList(String base, String filter, + public IDBVirtualList<Object> createVirtualList(String base, String filter, String attrs[], String startFrom, String sortKey, int pageSize) throws EBaseException { return new DBVirtualList<Object>(mDBSystem.getRegistry(), mConn, base, filter, attrs, startFrom, sortKey, pageSize); diff --git a/pki/base/common/src/com/netscape/cmscore/dbs/DBSubsystem.java b/pki/base/common/src/com/netscape/cmscore/dbs/DBSubsystem.java index 4adb17dd8..4bc5b6471 100644 --- a/pki/base/common/src/com/netscape/cmscore/dbs/DBSubsystem.java +++ b/pki/base/common/src/com/netscape/cmscore/dbs/DBSubsystem.java @@ -526,6 +526,7 @@ public class DBSubsystem implements IDBSubsystem { * applications can use. Optionally, check the integrity * of the database. */ + @SuppressWarnings("unchecked") public void init(ISubsystem owner, IConfigStore config) throws EBaseException { diff --git a/pki/base/common/src/com/netscape/cmscore/dbs/Repository.java b/pki/base/common/src/com/netscape/cmscore/dbs/Repository.java index b89f388ce..aadfb888a 100644 --- a/pki/base/common/src/com/netscape/cmscore/dbs/Repository.java +++ b/pki/base/common/src/com/netscape/cmscore/dbs/Repository.java @@ -23,7 +23,6 @@ import com.netscape.certsrv.apps.CMS; import com.netscape.certsrv.base.EBaseException; import com.netscape.certsrv.dbs.EDBException; import com.netscape.certsrv.dbs.IDBObj; -import com.netscape.certsrv.dbs.IDBRegistry; import com.netscape.certsrv.dbs.IDBSSession; import com.netscape.certsrv.dbs.IDBSubsystem; import com.netscape.certsrv.dbs.Modification; @@ -90,23 +89,20 @@ public abstract class Repository implements IRepository { BI_INCREMENT = new BigInteger(Integer.toString(increment)); + /* // register schema IDBRegistry reg = db.getRegistry(); - - /** - * if (!reg.isObjectClassRegistered( - * RepositoryRecord.class.getName())) { - * String repRecordOC[] = new String[2]; - * repRecordOC[0] = RepositorySchema.LDAP_OC_TOP; - * repRecordOC[1] = RepositorySchema.LDAP_OC_REPOSITORY; - * reg.registerObjectClass( - * RepositoryRecord.class.getName(), repRecordOC); - * } - * if (!reg.isAttributeRegistered(RepositoryRecord.ATTR_SERIALNO)) { - * reg.registerAttribute(RepositoryRecord.ATTR_SERIALNO, - * new BigIntegerMapper(RepositorySchema.LDAP_ATTR_SERIALNO)); - * } - **/ + if (!reg.isObjectClassRegistered(RepositoryRecord.class.getName())) { + String repRecordOC[] = new String[2]; + repRecordOC[0] = RepositorySchema.LDAP_OC_TOP; + repRecordOC[1] = RepositorySchema.LDAP_OC_REPOSITORY; + reg.registerObjectClass(RepositoryRecord.class.getName(), repRecordOC); + } + if (!reg.isAttributeRegistered(RepositoryRecord.ATTR_SERIALNO)) { + reg.registerAttribute(RepositoryRecord.ATTR_SERIALNO, + new BigIntegerMapper(RepositorySchema.LDAP_ATTR_SERIALNO)); + } + */ } /** @@ -256,7 +252,6 @@ public abstract class Repository implements IRepository { */ private void initCache() throws EBaseException { mNext = getSerialNumber(); - BigInteger serialConfig = new BigInteger("0"); mRadix = 10; CMS.debug("Repository: in InitCache"); diff --git a/pki/base/common/src/com/netscape/cmscore/ldap/LdapPredicateParser.java b/pki/base/common/src/com/netscape/cmscore/ldap/LdapPredicateParser.java index a752c1e29..469ba62a0 100644 --- a/pki/base/common/src/com/netscape/cmscore/ldap/LdapPredicateParser.java +++ b/pki/base/common/src/com/netscape/cmscore/ldap/LdapPredicateParser.java @@ -68,8 +68,6 @@ public class LdapPredicateParser { // The first token cannot be an operator. We are not dealing with // reverse-polish notation. String token = pt.nextToken(); - boolean opANDSeen; - boolean opORSeen; if (getOP(token) != EXPRESSION) { if (Debug.ON) @@ -78,7 +76,7 @@ public class LdapPredicateParser { } ILdapExpression current = parseExpression(token); boolean malformed = false; - Vector expSet = new Vector(); + Vector<ILdapExpression> expSet = new Vector<ILdapExpression>(); int prevType = EXPRESSION; while (pt.hasMoreTokens()) { @@ -156,7 +154,7 @@ public class LdapPredicateParser { if (commaIndex < 0) return LdapSimpleExpression.parse(input); int currentIndex = 0; - Vector expVector = new Vector(); + Vector<LdapSimpleExpression> expVector = new Vector<LdapSimpleExpression>(); while (commaIndex > 0) { LdapSimpleExpression exp = (LdapSimpleExpression) diff --git a/pki/base/common/src/com/netscape/cmscore/ldap/PublisherProcessor.java b/pki/base/common/src/com/netscape/cmscore/ldap/PublisherProcessor.java index 147eee07e..453703443 100644 --- a/pki/base/common/src/com/netscape/cmscore/ldap/PublisherProcessor.java +++ b/pki/base/common/src/com/netscape/cmscore/ldap/PublisherProcessor.java @@ -49,7 +49,6 @@ import com.netscape.certsrv.publish.ILdapPublisher; import com.netscape.certsrv.publish.ILdapRule; import com.netscape.certsrv.publish.IPublisherProcessor; import com.netscape.certsrv.publish.IXcertPublisherProcessor; -import com.netscape.certsrv.publish.LdapCertMapResult; import com.netscape.certsrv.publish.MapperPlugin; import com.netscape.certsrv.publish.MapperProxy; import com.netscape.certsrv.publish.PublisherPlugin; @@ -786,7 +785,6 @@ public class PublisherProcessor implements ruleInst = (ILdapRule) Class.forName(className).newInstance(); Vector<String> v = ruleInst.getInstanceParams(); - IConfigStore rc = ruleInst.getConfigStore(); return v; } catch (InstantiationException e) { @@ -1324,8 +1322,6 @@ public class PublisherProcessor implements Object dirdn = null; if (mapper != null) { - LdapCertMapResult result = null; - if (mLdapConnModule != null) { try { conn = mLdapConnModule.getConn(); @@ -1394,8 +1390,6 @@ public class PublisherProcessor implements String dirdn = null; if (mapper != null) { - LdapCertMapResult result = null; - if (mLdapConnModule != null) { conn = mLdapConnModule.getConn(); } @@ -1439,8 +1433,6 @@ public class PublisherProcessor implements String dirdn = null; if (mapper != null) { - LdapCertMapResult result = null; - if (mLdapConnModule != null) { conn = mLdapConnModule.getConn(); } diff --git a/pki/base/common/src/com/netscape/cmscore/logging/LogQueue.java b/pki/base/common/src/com/netscape/cmscore/logging/LogQueue.java index 6ed38a699..90ca05d81 100644 --- a/pki/base/common/src/com/netscape/cmscore/logging/LogQueue.java +++ b/pki/base/common/src/com/netscape/cmscore/logging/LogQueue.java @@ -34,7 +34,7 @@ import com.netscape.certsrv.logging.ILogQueue; public class LogQueue implements ILogQueue { private static LogQueue mLogQueue = new LogQueue(); - protected Vector mListeners = null; + protected Vector<ILogEventListener> mListeners = null; /** * Constructs a log queue. @@ -52,7 +52,7 @@ public class LogQueue implements ILogQueue { * */ public void init() { - mListeners = new Vector(); + mListeners = new Vector<ILogEventListener>(); } diff --git a/pki/base/common/src/com/netscape/cmscore/notification/EmailFormProcessor.java b/pki/base/common/src/com/netscape/cmscore/notification/EmailFormProcessor.java index 54a92f723..a057484cf 100644 --- a/pki/base/common/src/com/netscape/cmscore/notification/EmailFormProcessor.java +++ b/pki/base/common/src/com/netscape/cmscore/notification/EmailFormProcessor.java @@ -193,7 +193,6 @@ public class EmailFormProcessor implements IEmailFormProcessor { // -- for bug 382162, don't remove the following line, in // case John changes his mind for the better // mContent.add(TOK_PREFIX+t); - int tl = token_keys.length; for (int i = 0; i < token_keys.length; i++) { if (t.startsWith(token_keys[i])) { diff --git a/pki/base/common/src/com/netscape/cmscore/policy/PolicyPredicateParser.java b/pki/base/common/src/com/netscape/cmscore/policy/PolicyPredicateParser.java index 4046c789f..6c73bcb96 100644 --- a/pki/base/common/src/com/netscape/cmscore/policy/PolicyPredicateParser.java +++ b/pki/base/common/src/com/netscape/cmscore/policy/PolicyPredicateParser.java @@ -68,8 +68,6 @@ public class PolicyPredicateParser { // The first token cannot be an operator. We are not dealing with // reverse-polish notation. String token = pt.nextToken(); - boolean opANDSeen; - boolean opORSeen; if (getOP(token) != EXPRESSION) { if (Debug.ON) @@ -78,7 +76,7 @@ public class PolicyPredicateParser { } IExpression current = parseExpression(token); boolean malformed = false; - Vector expSet = new Vector(); + Vector<IExpression> expSet = new Vector<IExpression>(); int prevType = EXPRESSION; while (pt.hasMoreTokens()) { @@ -156,7 +154,7 @@ public class PolicyPredicateParser { if (commaIndex < 0) return SimpleExpression.parse(input); int currentIndex = 0; - Vector expVector = new Vector(); + Vector<SimpleExpression> expVector = new Vector<SimpleExpression>(); while (commaIndex > 0) { SimpleExpression exp = (SimpleExpression) diff --git a/pki/base/common/src/com/netscape/cmscore/profile/ProfileSubsystem.java b/pki/base/common/src/com/netscape/cmscore/profile/ProfileSubsystem.java index 2435fa462..585af5600 100644 --- a/pki/base/common/src/com/netscape/cmscore/profile/ProfileSubsystem.java +++ b/pki/base/common/src/com/netscape/cmscore/profile/ProfileSubsystem.java @@ -98,7 +98,7 @@ public class ProfileSubsystem implements IProfileSubsystem { String configPath = subStore.getString(PROP_CONFIG); CMS.debug("Start Profile Creation - " + id + " " + classid + " " + info.getClassName()); - IProfile profile = createProfile(id, classid, info.getClassName(), + createProfile(id, classid, info.getClassName(), configPath); CMS.debug("Done Profile Creation - " + id); diff --git a/pki/base/common/src/com/netscape/cmscore/request/ARequestQueue.java b/pki/base/common/src/com/netscape/cmscore/request/ARequestQueue.java index 0e252f523..16db3985c 100644 --- a/pki/base/common/src/com/netscape/cmscore/request/ARequestQueue.java +++ b/pki/base/common/src/com/netscape/cmscore/request/ARequestQueue.java @@ -902,7 +902,6 @@ class Request return true; } - @SuppressWarnings("unchecked") public boolean setExtData(String key, Hashtable<String, String> value) { if (!(isValidExtDataKey(key) && isValidExtDataHashtableValue(value))) { return false; diff --git a/pki/base/common/src/com/netscape/cmscore/security/KeyCertUtil.java b/pki/base/common/src/com/netscape/cmscore/security/KeyCertUtil.java index 20cdae832..2a9afb868 100644 --- a/pki/base/common/src/com/netscape/cmscore/security/KeyCertUtil.java +++ b/pki/base/common/src/com/netscape/cmscore/security/KeyCertUtil.java @@ -485,7 +485,6 @@ public class KeyCertUtil { SEQUENCE seq = (SEQUENCE) ASN1Util.decode(outerSeq, pubkBytes); BIT_STRING bs = (BIT_STRING) seq.elementAt(1); - byte[] bits = bs.getBits(); ByteArrayInputStream bitstream = new ByteArrayInputStream(bs.getBits()); ASN1Header wrapper = new ASN1Header(bitstream); byte[] valBytes = new byte[(int) wrapper.getContentLength()]; diff --git a/pki/base/common/src/com/netscape/cmscore/security/PWCBsdr.java b/pki/base/common/src/com/netscape/cmscore/security/PWCBsdr.java index 49c84d526..32a0e90ed 100644 --- a/pki/base/common/src/com/netscape/cmscore/security/PWCBsdr.java +++ b/pki/base/common/src/com/netscape/cmscore/security/PWCBsdr.java @@ -151,9 +151,7 @@ public class PWCBsdr implements PasswordCallback { if (pw != null) { CMS.debug("non-null password returned in first attempt"); - String tmp = new String(pw.getCharCopy()); - - return (pw); + return pw; } else { /* password not found */ // we don't want caller to do getPasswordAgain, for now log(ILogger.LL_FAILURE, CMS.getLogMessage("CMSCORE_SECURITY_THROW_CALLBACK")); diff --git a/pki/base/common/src/com/netscape/cmscore/usrgrp/UGSubsystem.java b/pki/base/common/src/com/netscape/cmscore/usrgrp/UGSubsystem.java index 6796a3322..a4c4d6854 100644 --- a/pki/base/common/src/com/netscape/cmscore/usrgrp/UGSubsystem.java +++ b/pki/base/common/src/com/netscape/cmscore/usrgrp/UGSubsystem.java @@ -1511,7 +1511,6 @@ public final class UGSubsystem implements IUGSubsystem { try { LDAPAttribute attrMembers = new LDAPAttribute("uniquemember"); LDAPModificationSet mod = new LDAPModificationSet(); - String st = null; String desc = grp.getDescription(); diff --git a/pki/base/common/src/com/netscape/cmscore/util/Debug.java b/pki/base/common/src/com/netscape/cmscore/util/Debug.java index 66e316c11..8c41d5bb5 100644 --- a/pki/base/common/src/com/netscape/cmscore/util/Debug.java +++ b/pki/base/common/src/com/netscape/cmscore/util/Debug.java @@ -40,15 +40,15 @@ public class Debug so I create a thread-local DateFormatter for each thread */ private static String DATE_PATTERN = "dd/MMM/yyyy:HH:mm:ss"; - private static ThreadLocal mFormatObject = new ThreadLocal() { - protected synchronized Object initialValue() { + private static ThreadLocal<SimpleDateFormat> mFormatObject = new ThreadLocal<SimpleDateFormat>() { + protected synchronized SimpleDateFormat initialValue() { return new SimpleDateFormat(DATE_PATTERN); } }; /* the dateformatter should be accessed with this function */ private static SimpleDateFormat getDateFormatter() { - return ((SimpleDateFormat) (mFormatObject.get())); + return mFormatObject.get(); } public static final boolean ON = false; diff --git a/pki/base/common/src/com/netscape/cmscore/util/FileAsString.java b/pki/base/common/src/com/netscape/cmscore/util/FileAsString.java index 27d5b6c79..7853346f5 100644 --- a/pki/base/common/src/com/netscape/cmscore/util/FileAsString.java +++ b/pki/base/common/src/com/netscape/cmscore/util/FileAsString.java @@ -50,7 +50,7 @@ public class FileAsString { private void readFile() throws IOException { BufferedReader br = createBufferedReader(mFilename); - StringBuffer buf = new StringBuffer(""); + StringBuffer buf = new StringBuffer(); int bytesread = 0; do { @@ -60,7 +60,6 @@ public class FileAsString { if (bytesread > 0) { buf.append(cbuf, 0, bytesread); } - String s = new String(buf); } while (bytesread != -1); br.close(); diff --git a/pki/base/common/src/com/netscape/cmscore/util/FileDialogFilter.java b/pki/base/common/src/com/netscape/cmscore/util/FileDialogFilter.java index 454c3c8db..eb1d1097a 100644 --- a/pki/base/common/src/com/netscape/cmscore/util/FileDialogFilter.java +++ b/pki/base/common/src/com/netscape/cmscore/util/FileDialogFilter.java @@ -63,7 +63,6 @@ public class FileDialogFilter implements FilenameFilter { */ boolean searchPattern(String fileName, String filter) { int filterCursor = 0; - int fileNameCursor = 0; int filterChar = filter.charAt(filterCursor); diff --git a/pki/base/common/src/com/netscape/cmscore/util/ProfileSubsystem.java b/pki/base/common/src/com/netscape/cmscore/util/ProfileSubsystem.java index 3ee2d3ab4..caf05c6df 100644 --- a/pki/base/common/src/com/netscape/cmscore/util/ProfileSubsystem.java +++ b/pki/base/common/src/com/netscape/cmscore/util/ProfileSubsystem.java @@ -165,12 +165,12 @@ public class ProfileSubsystem extends Frame implements ISubsystem, Runnable { public void updateThreadPanel() { Thread currentThread = Thread.currentThread(); - Vector data = new Vector(); + Vector<Vector<String>> data = new Vector<Vector<String>>(); Thread threads[] = new Thread[100]; int numThreads = Thread.enumerate(threads); for (int i = 0; i < numThreads; i++) { - Vector row = new Vector(); + Vector<String> row = new Vector<String>(); row.addElement(threads[i].getName()); row.addElement(threads[i].getThreadGroup().getName()); @@ -185,7 +185,7 @@ public class ProfileSubsystem extends Frame implements ISubsystem, Runnable { data.addElement(row); } - Vector colNames = new Vector(); + Vector<String> colNames = new Vector<String>(); colNames.addElement("Name"); colNames.addElement("Group"); @@ -220,13 +220,13 @@ class ThreadTableModel extends AbstractTableModel { * */ private static final long serialVersionUID = -6977965542104110870L; - Vector rowData; - Vector columnNames; + Vector<Vector<String>> rowData; + Vector<String> columnNames; public ThreadTableModel() { } - public void setInfo(Vector _rowData, Vector _columnNames) { + public void setInfo(Vector<Vector<String>> _rowData, Vector<String> _columnNames) { rowData = _rowData; columnNames = _columnNames; } @@ -243,16 +243,16 @@ class ThreadTableModel extends AbstractTableModel { return columnNames.size(); } - public Object getValueAt(int row, int column) { - return ((Vector) rowData.elementAt(row)).elementAt(column); + public String getValueAt(int row, int column) { + return rowData.elementAt(row).elementAt(column); } public boolean isCellEditable(int row, int column) { return false; } - public void setValueAt(Object value, int row, int column) { - ((Vector) rowData.elementAt(row)).setElementAt(value, column); + public void setValueAt(String value, int row, int column) { + rowData.elementAt(row).setElementAt(value, column); fireTableCellUpdated(row, column); } } diff --git a/pki/base/common/test/com/netscape/certsrv/request/AgentApprovalsTest.java b/pki/base/common/test/com/netscape/certsrv/request/AgentApprovalsTest.java index 8770dca2b..e7606951d 100644 --- a/pki/base/common/test/com/netscape/certsrv/request/AgentApprovalsTest.java +++ b/pki/base/common/test/com/netscape/certsrv/request/AgentApprovalsTest.java @@ -61,19 +61,19 @@ public class AgentApprovalsTest extends CMSBaseTestCase { assertEquals(approval3.getDate(), approval.getDate()); // test bad data - stringVector = new Vector(); + stringVector = new Vector<String>(); stringVector.add("foo"); assertNull(AgentApprovals.fromStringVector(stringVector)); - stringVector = new Vector(); + stringVector = new Vector<String>(); stringVector.add(";foo"); assertNull(AgentApprovals.fromStringVector(stringVector)); - stringVector = new Vector(); + stringVector = new Vector<String>(); stringVector.add("bar;foo"); assertNull(AgentApprovals.fromStringVector(stringVector)); - stringVector = new Vector(); + stringVector = new Vector<String>(); stringVector.add("00123b;foo"); assertNull(AgentApprovals.fromStringVector(stringVector)); diff --git a/pki/base/common/test/com/netscape/cmscore/request/RequestTest.java b/pki/base/common/test/com/netscape/cmscore/request/RequestTest.java index b396c2d35..5832f6af5 100644 --- a/pki/base/common/test/com/netscape/cmscore/request/RequestTest.java +++ b/pki/base/common/test/com/netscape/cmscore/request/RequestTest.java @@ -91,7 +91,6 @@ public class RequestTest extends CMSBaseTestCase { assertFalse(request.setExtData("key", (String) null)); } - @SuppressWarnings({ "rawtypes", "unchecked" }) public void testVerifyValidExtDataHashtable() { Hashtable<String, String> valueHash = new Hashtable<String, String>(); diff --git a/pki/base/java-tools/src/com/netscape/cmstools/CMCResponse.java b/pki/base/java-tools/src/com/netscape/cmstools/CMCResponse.java index 21e3b4187..4d68dd151 100644 --- a/pki/base/java-tools/src/com/netscape/cmstools/CMCResponse.java +++ b/pki/base/java-tools/src/com/netscape/cmstools/CMCResponse.java @@ -140,8 +140,6 @@ public class CMCResponse { System.out.println(" OtherInfo type: PEND"); PendInfo pi = oi.getPendInfo(); if (pi.getPendTime() != null) { - byte[] bp = pi.getPendToken().toByteArray(); - String pt = new String(bp); String datePattern = "dd/MMM/yyyy:HH:mm:ss z"; SimpleDateFormat dateFormat = new SimpleDateFormat(datePattern); Date d = pi.getPendTime().toDate(); diff --git a/pki/base/java-tools/src/com/netscape/cmstools/CRMFPopClient.java b/pki/base/java-tools/src/com/netscape/cmstools/CRMFPopClient.java index 22ebd6715..ea427ff7c 100644 --- a/pki/base/java-tools/src/com/netscape/cmstools/CRMFPopClient.java +++ b/pki/base/java-tools/src/com/netscape/cmstools/CRMFPopClient.java @@ -29,7 +29,6 @@ import java.net.URLEncoder; import java.security.KeyPair; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; -import java.util.Date; import netscape.security.x509.X500Name; @@ -261,7 +260,6 @@ public class CRMFPopClient { URLConnection conn = null; InputStream is = null; BufferedReader reader = null; - long total_time = 0; KeyPair pair = null; boolean foundTransport = false; @@ -419,7 +417,6 @@ public class CRMFPopClient { certReq.encode(bo); byte[] toBeVerified = bo.toByteArray(); - byte popdata[] = ASN1Util.encode(certReq); byte signature[]; System.out.println("."); //CertRequest encoded"); @@ -505,7 +502,6 @@ public class CRMFPopClient { System.out.println("--------------------"); System.out.println(""); - long start_time = (new Date()).getTime(); conn = url.openConnection(); is = conn.getInputStream(); reader = new BufferedReader(new InputStreamReader(is)); @@ -517,8 +513,7 @@ public class CRMFPopClient { System.out.println(""); } } /* while */ - long end_time = (new Date()).getTime(); - total_time += (end_time - start_time); + } catch (Exception e) { System.out.println("WARNING: " + e.toString()); e.printStackTrace(); diff --git a/pki/base/java-tools/src/com/netscape/cmstools/HttpClient.java b/pki/base/java-tools/src/com/netscape/cmstools/HttpClient.java index e98847611..c8817b52f 100644 --- a/pki/base/java-tools/src/com/netscape/cmstools/HttpClient.java +++ b/pki/base/java-tools/src/com/netscape/cmstools/HttpClient.java @@ -34,7 +34,6 @@ import java.net.SocketException; import java.util.StringTokenizer; import org.mozilla.jss.CryptoManager; -import org.mozilla.jss.crypto.CryptoStore; import org.mozilla.jss.crypto.CryptoToken; import org.mozilla.jss.crypto.X509Certificate; import org.mozilla.jss.ssl.SSLHandshakeCompletedEvent; @@ -145,7 +144,6 @@ public class HttpClient { CryptoToken token = cm.getInternalKeyStorageToken(); Password pass = new Password(password.toCharArray()); token.login(pass); - CryptoStore store = token.getCryptoStore(); X509Certificate cert = cm.findCertByNickname(nickname); if (cert == null) System.out.println("client cert is null"); diff --git a/pki/base/java-tools/src/com/netscape/cmstools/OCSPClient.java b/pki/base/java-tools/src/com/netscape/cmstools/OCSPClient.java index d127fd99a..5b9abe495 100644 --- a/pki/base/java-tools/src/com/netscape/cmstools/OCSPClient.java +++ b/pki/base/java-tools/src/com/netscape/cmstools/OCSPClient.java @@ -47,7 +47,6 @@ import com.netscape.cmsutil.ocsp.CertStatus; import com.netscape.cmsutil.ocsp.GoodInfo; import com.netscape.cmsutil.ocsp.OCSPRequest; import com.netscape.cmsutil.ocsp.OCSPResponse; -import com.netscape.cmsutil.ocsp.OCSPResponseStatus; import com.netscape.cmsutil.ocsp.Request; import com.netscape.cmsutil.ocsp.ResponseBytes; import com.netscape.cmsutil.ocsp.ResponseData; @@ -168,7 +167,6 @@ public class OCSPClient { new FileInputStream(output)); OCSPResponse resp = (OCSPResponse) OCSPResponse.getTemplate().decode(fis); - OCSPResponseStatus status = resp.getResponseStatus(); ResponseBytes bytes = resp.getResponseBytes(); BasicOCSPResponse basic = (BasicOCSPResponse) BasicOCSPResponse.getTemplate().decode( diff --git a/pki/base/java-tools/src/com/netscape/cmstools/PKCS12Export.java b/pki/base/java-tools/src/com/netscape/cmstools/PKCS12Export.java index 8be0b98dd..8d8e858f2 100644 --- a/pki/base/java-tools/src/com/netscape/cmstools/PKCS12Export.java +++ b/pki/base/java-tools/src/com/netscape/cmstools/PKCS12Export.java @@ -198,7 +198,6 @@ public class PKCS12Export { String pwdfile = null; String dir = null; - String snickname = null; String pk12pwdfile = null; String pk12output = null; for (int i = 0; i < args.length; i++) { @@ -207,7 +206,7 @@ public class PKCS12Export { } else if (args[i].equals("-p")) { pwdfile = args[i + 1]; } else if (args[i].equals("-s")) { - snickname = args[i + 1]; + // snickname = args[i + 1]; } else if (args[i].equals("-w")) { pk12pwdfile = args[i + 1]; } else if (args[i].equals("-o")) { diff --git a/pki/base/kra/src/com/netscape/kra/EncryptionUnit.java b/pki/base/kra/src/com/netscape/kra/EncryptionUnit.java index 32c17b08a..946f57613 100644 --- a/pki/base/kra/src/com/netscape/kra/EncryptionUnit.java +++ b/pki/base/kra/src/com/netscape/kra/EncryptionUnit.java @@ -85,7 +85,6 @@ public abstract class EncryptionUnit implements IEncryptionUnit { throws EBaseException { try { CMS.debug("EncryptionUnit.encryptInternalPrivate"); - CryptoToken token = getToken(); CryptoToken internalToken = getInternalToken(); // (1) generate session key diff --git a/pki/base/kra/src/com/netscape/kra/KeyRecoveryAuthority.java b/pki/base/kra/src/com/netscape/kra/KeyRecoveryAuthority.java index c195a78ae..cf2b2d52a 100644 --- a/pki/base/kra/src/com/netscape/kra/KeyRecoveryAuthority.java +++ b/pki/base/kra/src/com/netscape/kra/KeyRecoveryAuthority.java @@ -1424,8 +1424,6 @@ public class KeyRecoveryAuthority implements IAuthority, IKeyService, IKeyRecove nc = mConfig.getSubStore(PROP_NOTIFY_SUBSTORE); if (nc != null && nc.size() > 0) { // Initialize Request In Queue notification listener - IConfigStore rq = nc.getSubStore(PROP_REQ_IN_Q_SUBSTORE); - String requestInQListenerClassName = nc.getString("certificateIssuedListenerClassName", "com.netscape.cms.listeners.RequestInQListener"); @@ -1662,13 +1660,11 @@ public class KeyRecoveryAuthority implements IAuthority, IKeyService, IKeyRecove } byte rawData[] = cert.getPublicKey().getEncoded(); - String key = null; // convert "rawData" into "base64Data" if (rawData != null) { - String base64Data = null; - - base64Data = CMS.BtoA(rawData).trim(); + String base64Data = CMS.BtoA(rawData).trim(); + String key = ""; // extract all line separators from the "base64Data" for (int i = 0; i < base64Data.length(); i++) { @@ -1676,6 +1672,8 @@ public class KeyRecoveryAuthority implements IAuthority, IKeyService, IKeyRecove key += base64Data.substring(i, i); } } + + return key; } return ILogger.SIGNED_AUDIT_EMPTY_VALUE; diff --git a/pki/base/kra/src/com/netscape/kra/RecoveryService.java b/pki/base/kra/src/com/netscape/kra/RecoveryService.java index 89f8f042a..c8ecdcf5a 100644 --- a/pki/base/kra/src/com/netscape/kra/RecoveryService.java +++ b/pki/base/kra/src/com/netscape/kra/RecoveryService.java @@ -272,8 +272,8 @@ public class RecoveryService implements IService { if (statsSub != null) { statsSub.startTiming("unwrap_key"); } - PrivateKey privateKey = mKRA.getStorageKeyUnit().unwrap( - keyRecord.getPrivateKeyData(), null); + mKRA.getStorageKeyUnit().unwrap( + keyRecord.getPrivateKeyData(), null); // throw exception on error if (statsSub != null) { statsSub.endTiming("unwrap_key"); } diff --git a/pki/base/migrate/80/MigrateSecurityDomain.java b/pki/base/migrate/80/MigrateSecurityDomain.java index 420e17805..4624f1259 100644 --- a/pki/base/migrate/80/MigrateSecurityDomain.java +++ b/pki/base/migrate/80/MigrateSecurityDomain.java @@ -187,10 +187,10 @@ public class MigrateSecurityDomain { NodeList nodeList = doc.getElementsByTagName(type); int len = nodeList.getLength(); for (int i = 0; i < len; i++) { - Vector v_clone = parser.getValuesFromContainer(nodeList.item(i), "Clone"); - Vector v_name = parser.getValuesFromContainer(nodeList.item(i), "SubsystemName"); - Vector v_host = parser.getValuesFromContainer(nodeList.item(i), "Host"); - Vector v_port = parser.getValuesFromContainer(nodeList.item(i), "SecurePort"); + Vector<String> v_clone = parser.getValuesFromContainer(nodeList.item(i), "Clone"); + Vector<String> v_name = parser.getValuesFromContainer(nodeList.item(i), "SubsystemName"); + Vector<String> v_host = parser.getValuesFromContainer(nodeList.item(i), "Host"); + Vector<String> v_port = parser.getValuesFromContainer(nodeList.item(i), "SecurePort"); String cn = (String) v_host.elementAt(0) + ":" + (String) v_port.elementAt(0); String dn = "cn=" + cn + ",cn=" + type + "List,ou=Security Domain," + basedn; diff --git a/pki/base/silent/src/com/netscape/pkisilent/argparser/StringScanner.java b/pki/base/silent/src/com/netscape/pkisilent/argparser/StringScanner.java index c6bddf26c..271dd0c62 100644 --- a/pki/base/silent/src/com/netscape/pkisilent/argparser/StringScanner.java +++ b/pki/base/silent/src/com/netscape/pkisilent/argparser/StringScanner.java @@ -372,7 +372,6 @@ class StringScanner { char c; // parse [-][0-9]*[.][0-9]*[eE][-][0-9]* boolean hasDigits = false; - boolean signed; double value = 0; skipWhiteSpace(); @@ -380,7 +379,7 @@ class StringScanner { exception = new StringScanException("end of input"); } else { if ((c = buf[idx]) == '-' || c == '+') { - signed = true; + // signed idx++; } if (matchDigits()) { @@ -402,7 +401,7 @@ class StringScanner { if ((c = buf[idx]) == 'e' || c == 'E') { idx++; if ((c = buf[idx]) == '-' || c == '+') { - signed = true; + // signed idx++; } if (buf[idx] < '0' || buf[idx] > '9') { diff --git a/pki/base/silent/src/com/netscape/pkisilent/common/CMSConfig.java b/pki/base/silent/src/com/netscape/pkisilent/common/CMSConfig.java index f5737167e..3e4f0bfa2 100644 --- a/pki/base/silent/src/com/netscape/pkisilent/common/CMSConfig.java +++ b/pki/base/silent/src/com/netscape/pkisilent/common/CMSConfig.java @@ -558,8 +558,8 @@ public class CMSConfig extends ServerInfo { } CMSConfig s = new CMSConfig(args[0]); - boolean secureC = false; + // boolean secureC = false; // s.EnableDirEnrollment(secureC); s.saveCMSConfig(); diff --git a/pki/base/silent/src/com/netscape/pkisilent/common/Con2Agent.java b/pki/base/silent/src/com/netscape/pkisilent/common/Con2Agent.java index 8071dcb29..61305305e 100644 --- a/pki/base/silent/src/com/netscape/pkisilent/common/Con2Agent.java +++ b/pki/base/silent/src/com/netscape/pkisilent/common/Con2Agent.java @@ -23,7 +23,6 @@ import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.PrintStream; -import java.util.Enumeration; import java.util.Vector; import org.mozilla.jss.CryptoManager; @@ -77,16 +76,9 @@ public class Con2Agent implements SSLClientCertificateSelectionCallback, } public String select(@SuppressWarnings("rawtypes") Vector nicknames) { - Enumeration<?> e = nicknames.elements(); System.out.println("nicknames size = " + nicknames.size()); - int i = 0; - - while (e.hasMoreElements()) { - String s = (String) e.nextElement(); - - i++; - } + int i = nicknames.size(); if (i > 0) { return (String) nicknames.elementAt(0); @@ -165,8 +157,6 @@ public class Con2Agent implements SSLClientCertificateSelectionCallback, // Submit requests public boolean Send() { - boolean st = false; - try { if (!loginCertDB()) { @@ -235,7 +225,7 @@ public class Con2Agent implements SSLClientCertificateSelectionCallback, private boolean loginCertDB() { CryptoManager manager; - Password pass1 = null, pass2 = null; + Password pass1 = null; try { System.out.println("Step 1: Initializing CryptoManager"); @@ -282,8 +272,6 @@ public class Con2Agent implements SSLClientCertificateSelectionCallback, public boolean Send_withGET() { - boolean st = false; - try { if (!loginCertDB()) { diff --git a/pki/base/silent/src/com/netscape/pkisilent/common/ParseXML.java b/pki/base/silent/src/com/netscape/pkisilent/common/ParseXML.java index 22c1c402c..de1b38172 100644 --- a/pki/base/silent/src/com/netscape/pkisilent/common/ParseXML.java +++ b/pki/base/silent/src/com/netscape/pkisilent/common/ParseXML.java @@ -127,7 +127,6 @@ public class ParseXML { // returns an arraylist of values for the corresponding tag public ArrayList<String> constructValueList(String first, String second) { - String temp = null; ArrayList<String> al = new ArrayList<String>(); try { diff --git a/pki/base/silent/src/com/netscape/pkisilent/common/PostQuery.java b/pki/base/silent/src/com/netscape/pkisilent/common/PostQuery.java index b6ab3fe8c..31fb07b3e 100644 --- a/pki/base/silent/src/com/netscape/pkisilent/common/PostQuery.java +++ b/pki/base/silent/src/com/netscape/pkisilent/common/PostQuery.java @@ -83,7 +83,6 @@ public class PostQuery { try { - BufferedReader mbufferedReader = null; URL myUrl = new URL(URLString); String userPassword = adminID + ":" + adminPWD; @@ -108,8 +107,6 @@ public class PostQuery { System.out.println("Query: " + postQuery); - int querylength = postQuery.length(); - os.writeBytes(postQuery); os.flush(); os.close(); diff --git a/pki/base/silent/src/com/netscape/pkisilent/common/ServerInfo.java b/pki/base/silent/src/com/netscape/pkisilent/common/ServerInfo.java index f63a0f54b..f63456b4d 100644 --- a/pki/base/silent/src/com/netscape/pkisilent/common/ServerInfo.java +++ b/pki/base/silent/src/com/netscape/pkisilent/common/ServerInfo.java @@ -177,18 +177,6 @@ public class ServerInfo { String s = in.readLine(); while (s != null) { - // <SSLPARAMS servercertnickname="Server-Cert cert-firefly" - int index = s.indexOf("servercertnickname"); - - if (index >= 0) { - String str = s.substring(index + 20); - StringTokenizer tokenizer = new StringTokenizer(str, "\""); - - if (tokenizer.hasMoreElements()) { - String mServerCertNickname = tokenizer.nextToken(); - } - } - // <LS id="agent" ip="0.0.0.0" port="8101" security="on" // acceptorthreads="1" blocking="no"> if (s.startsWith("<LS id=")) { @@ -213,7 +201,7 @@ public class ServerInfo { } if (index1 != 5 && index2 == IP && !token.equals(" ip=")) { - String ip = token; + // token contains the ip value } else if (index2 == PORT && !token.equals(" port=")) { switch (index1) { diff --git a/pki/base/silent/src/com/netscape/pkisilent/common/TestClient.java b/pki/base/silent/src/com/netscape/pkisilent/common/TestClient.java index 87161d689..0e4ed9cdd 100644 --- a/pki/base/silent/src/com/netscape/pkisilent/common/TestClient.java +++ b/pki/base/silent/src/com/netscape/pkisilent/common/TestClient.java @@ -468,7 +468,6 @@ public class TestClient implements SSLCertificateApprovalCallback { public String getFreePort(String s) { Integer x = new Integer(s); int p = x.intValue(); - boolean st = true; // if p = 0, then the serversocket constructor get a free port by itself p = 0; @@ -756,10 +755,10 @@ public class TestClient implements SSLCertificateApprovalCallback { ************************************************************* */ - String TransportCert = + /* + String TransportCert = "MIICJTCCAY6gAwIBAgIBBTANBgkqhkiG9w0BAQQFADBDMRswGQYDVQQKExJhY2NlcHRhY25ldGVzdDEwMjQxFzAVBgNVBAsTDmFjY2VwdGFuY2V0ZXN0MQswCQYDVQQDEwJjYTAeFw0wMzA0MTgyMjMwMDhaFw0wNDA0MTcxMDI2MDhaMDkxETAPBgNVBAoTCHRlc3QxMDI0MRcwFQYDVQQLEw5hY2NlcHRhbmNldGVzdDELMAkGA1UEAxMCcmEwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAN6sQ3mSU8mL6i6gTZIXDLzOZPhYOkQLpnJjit5hcPZ0JMn0CQVXo4QjKN1xvuZv8qVlZoQw9czmzp/knTa0sCDgFKd0r+u0TnLeZkJMSimgFnma9CnChlaDHnBd8Beu4vyaHmo7rJ0xA4etn7HjhmKbaQZOcv/aP0SW9JXRga7ZAgMBAAGjMzAxMA4GA1UdDwEB/wQEAwIFIDAfBgNVHSMEGDAWgBSC3fsQHb7fddr2vL0UdkM2dAmUWzANBgkqhkiG9w0BAQQFAAOBgQBkAGbgd9HIqwoLKAr+V6bj9oWesDmDH80gPPxj10qyWSQYIs8PofOs/75yGS9nxhydtgSMFoBgCPdroUI31kZQQlFzxtudGoKD+5MWSXho79XzPwpjheOBYgpX6ch+L4tMLFDpqeraB1yZESO5EEeKm20DGVBOKVWxHhddO1BenA=="; - /* CRMFClient CrmfClient = new CRMFClient(s.GetHostName(),s.GetEEPort()); CrmfClient.setDBInfo(t.GetClientCertDB(),t.GetClientCertDBPW()); CrmfClient.setTransportCert(TransportCert); diff --git a/pki/base/silent/src/com/netscape/pkisilent/common/UserEnroll.java b/pki/base/silent/src/com/netscape/pkisilent/common/UserEnroll.java index e5c2f0b4a..5761c6f77 100644 --- a/pki/base/silent/src/com/netscape/pkisilent/common/UserEnroll.java +++ b/pki/base/silent/src/com/netscape/pkisilent/common/UserEnroll.java @@ -502,7 +502,6 @@ public class UserEnroll extends TestClient { public static void main(String args[]) { // Exit Status - (0) for error/Fail // - requestId Pass - boolean st; UserEnroll e = new UserEnroll("jupiter2", "1027", "E=test,cn=test,uid=test", "test", "test", "test", "t1", "t", diff --git a/pki/base/silent/src/com/netscape/pkisilent/http/HTTPClient.java b/pki/base/silent/src/com/netscape/pkisilent/http/HTTPClient.java index c9584463d..3c715226d 100644 --- a/pki/base/silent/src/com/netscape/pkisilent/http/HTTPClient.java +++ b/pki/base/silent/src/com/netscape/pkisilent/http/HTTPClient.java @@ -1081,7 +1081,6 @@ public class HTTPClient implements SSLCertificateApprovalCallback { public static void main(String args[]) { HTTPClient hc = new HTTPClient(); HTTPResponse hr = null; - byte[] responseData = null; // parse args StringHolder x_hostname = new StringHolder(); @@ -1208,8 +1207,6 @@ public class HTTPClient implements SSLCertificateApprovalCallback { // collect and print response - responseData = hr.getResponseData(); - if (hr.getStatusCode() == 200) System.out.println("Response from Host:" + cs_hostname + " OK"); else { diff --git a/pki/base/util/src/com/netscape/cmsutil/crypto/CryptoUtil.java b/pki/base/util/src/com/netscape/cmsutil/crypto/CryptoUtil.java index bf4de6a83..bf8a9cfc1 100644 --- a/pki/base/util/src/com/netscape/cmsutil/crypto/CryptoUtil.java +++ b/pki/base/util/src/com/netscape/cmsutil/crypto/CryptoUtil.java @@ -965,7 +965,6 @@ public class CryptoUtil { while (enums.hasMoreElements()) { CryptoToken token = enums.nextElement(); - String tokenName = token.getName(); CryptoStore store = token.getCryptoStore(); PrivateKey keys[] = store.getPrivateKeys(); diff --git a/pki/base/util/src/com/netscape/cmsutil/crypto/Module.java b/pki/base/util/src/com/netscape/cmsutil/crypto/Module.java index 16f948fd7..bf4a7fe73 100644 --- a/pki/base/util/src/com/netscape/cmsutil/crypto/Module.java +++ b/pki/base/util/src/com/netscape/cmsutil/crypto/Module.java @@ -28,20 +28,20 @@ public class Module { private String mUserFriendlyName = ""; private String mImagePath = ""; // a Vector of Tokens - private Vector mTokens = null; + private Vector<Token> mTokens = null; private boolean mFound = false; public Module(String name, String printName) { mCommonName = name; mUserFriendlyName = printName; - mTokens = new Vector(); + mTokens = new Vector<Token>(); } public Module(String name, String printName, String image) { mCommonName = name; mUserFriendlyName = printName; mImagePath = image; - mTokens = new Vector(); + mTokens = new Vector<Token>(); } public void addToken(CryptoToken t) { @@ -69,7 +69,7 @@ public class Module { mFound = isFound; } - public Vector getTokens() { + public Vector<Token> getTokens() { return mTokens; } } diff --git a/pki/base/util/src/com/netscape/cmsutil/xml/XMLObject.java b/pki/base/util/src/com/netscape/cmsutil/xml/XMLObject.java index 8317ad785..ed2fb67ee 100644 --- a/pki/base/util/src/com/netscape/cmsutil/xml/XMLObject.java +++ b/pki/base/util/src/com/netscape/cmsutil/xml/XMLObject.java @@ -122,8 +122,8 @@ public class XMLObject { return null; } - public Vector getAllValues(String tagname) { - Vector v = new Vector(); + public Vector<String> getAllValues(String tagname) { + Vector<String> v = new Vector<String>(); NodeList nodes = mDoc.getElementsByTagName(tagname); for (int i = 0; i < nodes.getLength(); i++) { Node n = nodes.item(i); diff --git a/pki/base/util/src/netscape/net/TransferProtocolClient.java b/pki/base/util/src/netscape/net/TransferProtocolClient.java index cadacaa0f..76e3a9c21 100644 --- a/pki/base/util/src/netscape/net/TransferProtocolClient.java +++ b/pki/base/util/src/netscape/net/TransferProtocolClient.java @@ -35,7 +35,7 @@ public class TransferProtocolClient extends NetworkClient { * Array of strings (usually 1 entry) for the last reply * from the server. */ - protected Vector serverResponse = new Vector(1); + protected Vector<String> serverResponse = new Vector<String>(1); /** code for last reply */ protected int lastReplyCode; @@ -112,7 +112,7 @@ public class TransferProtocolClient extends NetworkClient { } /** Returns all server response strings. */ - public Vector getResponseStrings() { + public Vector<String> getResponseStrings() { return serverResponse; } diff --git a/pki/base/util/src/netscape/security/extensions/GenericASN1Extension.java b/pki/base/util/src/netscape/security/extensions/GenericASN1Extension.java index 6e28b4a0e..ff1ea7173 100644 --- a/pki/base/util/src/netscape/security/extensions/GenericASN1Extension.java +++ b/pki/base/util/src/netscape/security/extensions/GenericASN1Extension.java @@ -73,9 +73,9 @@ public class GenericASN1Extension extends Extension * get, set, delete methods of Certificate, x509 type. */ private String name; - public static String OID = null; + public String OID = null; public static Hashtable<String, String> mConfig = null; - public static String pattern = null; + public String pattern = null; private int index = 0; // Encode this value @@ -325,7 +325,7 @@ public class GenericASN1Extension extends Extension * Return the OID of this attribute. */ public String getOID() { - return (OID); + return OID; } /** diff --git a/pki/base/util/src/netscape/security/extensions/PresenceServerExtension.java b/pki/base/util/src/netscape/security/extensions/PresenceServerExtension.java index a90abe7e3..c67fe9965 100644 --- a/pki/base/util/src/netscape/security/extensions/PresenceServerExtension.java +++ b/pki/base/util/src/netscape/security/extensions/PresenceServerExtension.java @@ -312,6 +312,8 @@ public class PresenceServerExtension extends Extension implements CertAttrSet { fos.close(); Extension ext1 = new Extension(new DerValue(dos.toByteArray())); + + @SuppressWarnings("unused") PresenceServerExtension ext2 = new PresenceServerExtension( new Boolean(false), ext1.getExtensionValue()); diff --git a/pki/base/util/src/netscape/security/pkcs/PKCS7.java b/pki/base/util/src/netscape/security/pkcs/PKCS7.java index 4de75a4e1..c8fb69582 100644 --- a/pki/base/util/src/netscape/security/pkcs/PKCS7.java +++ b/pki/base/util/src/netscape/security/pkcs/PKCS7.java @@ -336,7 +336,7 @@ public class PKCS7 { public SignerInfo[] verify(byte[] bytes) throws NoSuchAlgorithmException, SignatureException { - Vector intResult = new Vector(); + Vector<SignerInfo> intResult = new Vector<SignerInfo>(); for (int i = 0; i < signerInfos.length; i++) { SignerInfo signerInfo = verify(signerInfos[i], bytes); diff --git a/pki/base/util/src/netscape/security/util/DerInputStream.java b/pki/base/util/src/netscape/security/util/DerInputStream.java index e85d48ed6..20ced6757 100644 --- a/pki/base/util/src/netscape/security/util/DerInputStream.java +++ b/pki/base/util/src/netscape/security/util/DerInputStream.java @@ -314,7 +314,7 @@ public class DerInputStream { /* * Pull values out of the stream. */ - Vector vec = new Vector(startLen); + Vector<DerValue> vec = new Vector<DerValue>(startLen); DerValue value; do { diff --git a/pki/base/util/src/netscape/security/x509/Extension.java b/pki/base/util/src/netscape/security/x509/Extension.java index 5d0029875..7dc9e2890 100644 --- a/pki/base/util/src/netscape/security/x509/Extension.java +++ b/pki/base/util/src/netscape/security/x509/Extension.java @@ -177,7 +177,7 @@ public class Extension implements Serializable { byte[] dup = new byte[extensionValue.length]; System.arraycopy(extensionValue, 0, dup, 0, dup.length); - return (dup); + return dup; } public void setExtensionValue(byte value[]) { diff --git a/pki/base/util/src/netscape/security/x509/NSCCommentExtension.java b/pki/base/util/src/netscape/security/x509/NSCCommentExtension.java index b24ce1158..0912d5b0c 100644 --- a/pki/base/util/src/netscape/security/x509/NSCCommentExtension.java +++ b/pki/base/util/src/netscape/security/x509/NSCCommentExtension.java @@ -65,9 +65,9 @@ public class NSCCommentExtension extends Extension // Encode this extension value private void encodeThis() throws IOException { DerOutputStream os = new DerOutputStream(); - DerOutputStream tmp = new DerOutputStream(); os.putIA5String(mComment); + // DerOutputStream tmp = new DerOutputStream(); // os.write(DerValue.tag_Sequence,tmp); extensionValue = os.toByteArray(); } diff --git a/pki/base/util/src/netscape/security/x509/X500Name.java b/pki/base/util/src/netscape/security/x509/X500Name.java index 920b0e1e4..d44003baa 100644 --- a/pki/base/util/src/netscape/security/x509/X500Name.java +++ b/pki/base/util/src/netscape/security/x509/X500Name.java @@ -148,7 +148,6 @@ public class X500Name implements Principal, GeneralNameInterface { String country) throws IOException { DirStrConverter dirStrConverter = new DirStrConverter(); PrintableConverter printableConverter = new PrintableConverter(); - DerValue val; AVA[] assertion = new AVA[1]; // array is cloned in constructors. int i = 4; @@ -194,7 +193,6 @@ public class X500Name implements Principal, GeneralNameInterface { String country) throws IOException { DirStrConverter dirStrConverter = new DirStrConverter(); PrintableConverter printableConverter = new PrintableConverter(); - DerValue val; AVA[] assertion = new AVA[1]; // array is cloned in constructors. int i = 6; |