summaryrefslogtreecommitdiffstats
path: root/base/common/src/com/netscape/cmscore/authentication
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2012-04-05 15:08:18 -0500
committerEndi Sukma Dewata <edewata@redhat.com>2012-04-09 10:22:03 -0500
commit3f24e55923fc986af4c6a08b2b8d45704a905627 (patch)
tree716415853b5676b801f6707634305b59b9af8603 /base/common/src/com/netscape/cmscore/authentication
parent7c7b9d023cd466c1771068badc020dab36beb553 (diff)
downloadpki-3f24e55923fc986af4c6a08b2b8d45704a905627.tar.gz
pki-3f24e55923fc986af4c6a08b2b8d45704a905627.tar.xz
pki-3f24e55923fc986af4c6a08b2b8d45704a905627.zip
Removed unnecessary type casts.
Unnecessary type casts have been removed using Eclipse Quick Fix. Ticket #134
Diffstat (limited to 'base/common/src/com/netscape/cmscore/authentication')
-rw-r--r--base/common/src/com/netscape/cmscore/authentication/AuthSubsystem.java21
-rw-r--r--base/common/src/com/netscape/cmscore/authentication/CertUserDBAuthentication.java4
-rw-r--r--base/common/src/com/netscape/cmscore/authentication/ChallengePhraseAuthentication.java3
-rw-r--r--base/common/src/com/netscape/cmscore/authentication/SSLClientCertAuthentication.java6
4 files changed, 16 insertions, 18 deletions
diff --git a/base/common/src/com/netscape/cmscore/authentication/AuthSubsystem.java b/base/common/src/com/netscape/cmscore/authentication/AuthSubsystem.java
index 5c27d8c6a..fbb589376 100644
--- a/base/common/src/com/netscape/cmscore/authentication/AuthSubsystem.java
+++ b/base/common/src/com/netscape/cmscore/authentication/AuthSubsystem.java
@@ -125,7 +125,7 @@ public class AuthSubsystem implements IAuthSubsystem {
Enumeration<String> mImpls = c.getSubStoreNames();
while (mImpls.hasMoreElements()) {
- String id = (String) mImpls.nextElement();
+ String id = mImpls.nextElement();
String pluginPath = c.getString(id + "." + PROP_CLASS);
AuthMgrPlugin plugin = new AuthMgrPlugin(id, pluginPath);
@@ -194,10 +194,10 @@ public class AuthSubsystem implements IAuthSubsystem {
Enumeration<String> instances = c.getSubStoreNames();
while (instances.hasMoreElements()) {
- String insName = (String) instances.nextElement();
+ String insName = instances.nextElement();
String implName = c.getString(insName + "." + PROP_PLUGIN);
AuthMgrPlugin plugin =
- (AuthMgrPlugin) mAuthMgrPlugins.get(implName);
+ mAuthMgrPlugins.get(implName);
if (plugin == null) {
log(ILogger.LL_FAILURE, CMS.getLogMessage("CMSCORE_AUTH_CANT_FIND_PLUGIN", implName));
@@ -275,8 +275,7 @@ public class AuthSubsystem implements IAuthSubsystem {
IAuthCredentials authCred, String authMgrInstName)
throws EMissingCredential, EInvalidCredentials,
EAuthMgrNotFound, EBaseException {
- AuthManagerProxy proxy = (AuthManagerProxy)
- mAuthMgrInsts.get(authMgrInstName);
+ AuthManagerProxy proxy = mAuthMgrInsts.get(authMgrInstName);
if (proxy == null) {
throw new EAuthMgrNotFound(CMS.getUserMessage("CMS_AUTHENTICATION_AUTHMGR_NOT_FOUND", authMgrInstName));
@@ -316,7 +315,7 @@ public class AuthSubsystem implements IAuthSubsystem {
public String[] getConfigParams(String implName)
throws EAuthMgrPluginNotFound, EBaseException {
// is this a registered implname?
- AuthMgrPlugin plugin = (AuthMgrPlugin) mAuthMgrPlugins.get(implName);
+ AuthMgrPlugin plugin = mAuthMgrPlugins.get(implName);
if (plugin == null) {
log(ILogger.LL_FAILURE, CMS.getLogMessage("CMSCORE_AUTH_PLUGIN_NOT_FOUND", implName));
@@ -368,7 +367,7 @@ public class AuthSubsystem implements IAuthSubsystem {
* @return the named authentication manager instance
*/
public IAuthManager get(String name) {
- AuthManagerProxy proxy = (AuthManagerProxy) mAuthMgrInsts.get(name);
+ AuthManagerProxy proxy = mAuthMgrInsts.get(name);
if (proxy == null)
return null;
@@ -403,7 +402,7 @@ public class AuthSubsystem implements IAuthSubsystem {
* retrieve a single auth manager plugin by name
*/
public AuthMgrPlugin getAuthManagerPluginImpl(String name) {
- return (AuthMgrPlugin) mAuthMgrPlugins.get(name);
+ return mAuthMgrPlugins.get(name);
}
/**
@@ -412,7 +411,7 @@ public class AuthSubsystem implements IAuthSubsystem {
/* getconfigparams above should be recoded to use this func */
public IAuthManager getAuthManagerPlugin(String name) {
- AuthMgrPlugin plugin = (AuthMgrPlugin) mAuthMgrPlugins.get(name);
+ AuthMgrPlugin plugin = mAuthMgrPlugins.get(name);
String classpath = plugin.getClassPath();
IAuthManager authMgrInst = null;
@@ -461,7 +460,7 @@ public class AuthSubsystem implements IAuthSubsystem {
public void shutdown() {
for (Enumeration<String> e = mAuthMgrInsts.keys(); e.hasMoreElements();) {
- IAuthManager mgr = (IAuthManager) get((String) e.nextElement());
+ IAuthManager mgr = get(e.nextElement());
log(ILogger.LL_INFO, CMS.getLogMessage("CMSCORE_AUTH_INSTANCE_SHUTDOWN", mgr.getName()));
@@ -499,7 +498,7 @@ public class AuthSubsystem implements IAuthSubsystem {
* @return the named authentication manager
*/
public IAuthManager getAuthManager(String name) {
- return ((IAuthManager) get(name));
+ return get(name);
}
/**
diff --git a/base/common/src/com/netscape/cmscore/authentication/CertUserDBAuthentication.java b/base/common/src/com/netscape/cmscore/authentication/CertUserDBAuthentication.java
index e9fb6c891..d8db16ad0 100644
--- a/base/common/src/com/netscape/cmscore/authentication/CertUserDBAuthentication.java
+++ b/base/common/src/com/netscape/cmscore/authentication/CertUserDBAuthentication.java
@@ -99,8 +99,8 @@ public class CertUserDBAuthentication implements IAuthManager {
mRevocationCheckingEnabled = mRevocationChecking.getBoolean("enabled", false);
if (mRevocationCheckingEnabled) {
int size = mRevocationChecking.getInteger("bufferSize", 0);
- long interval = (long) mRevocationChecking.getInteger("validityInterval", 28800);
- long unknownStateInterval = (long) mRevocationChecking.getInteger("unknownStateInterval", 1800);
+ long interval = mRevocationChecking.getInteger("validityInterval", 28800);
+ long unknownStateInterval = mRevocationChecking.getInteger("unknownStateInterval", 1800);
if (size > 0)
CMS.setListOfVerifiedCerts(size, interval, unknownStateInterval);
diff --git a/base/common/src/com/netscape/cmscore/authentication/ChallengePhraseAuthentication.java b/base/common/src/com/netscape/cmscore/authentication/ChallengePhraseAuthentication.java
index f40145938..1040e6034 100644
--- a/base/common/src/com/netscape/cmscore/authentication/ChallengePhraseAuthentication.java
+++ b/base/common/src/com/netscape/cmscore/authentication/ChallengePhraseAuthentication.java
@@ -43,7 +43,6 @@ import com.netscape.certsrv.request.RequestStatus;
import com.netscape.certsrv.usrgrp.ICertUserLocator;
import com.netscape.cmscore.base.SubsystemRegistry;
import com.netscape.cmscore.dbs.CertRecord;
-import com.netscape.cmscore.dbs.CertificateRepository;
import com.netscape.cmscore.util.Debug;
import com.netscape.cmsutil.util.Utils;
@@ -149,7 +148,7 @@ public class ChallengePhraseAuthentication implements IAuthManager {
SubsystemRegistry.getInstance().get("ca");
if (mCA != null) {
- mCertDB = (CertificateRepository) mCA.getCertificateRepository();
+ mCertDB = mCA.getCertificateRepository();
}
AuthToken authToken = new AuthToken(this);
diff --git a/base/common/src/com/netscape/cmscore/authentication/SSLClientCertAuthentication.java b/base/common/src/com/netscape/cmscore/authentication/SSLClientCertAuthentication.java
index 183cebcfb..4906d5c50 100644
--- a/base/common/src/com/netscape/cmscore/authentication/SSLClientCertAuthentication.java
+++ b/base/common/src/com/netscape/cmscore/authentication/SSLClientCertAuthentication.java
@@ -113,7 +113,7 @@ public class SSLClientCertAuthentication implements IAuthManager {
mCA = (ICertificateAuthority) CMS.getSubsystem("ca");
if (mCA != null) {
- mCertDB = (ICertificateRepository) mCA.getCertificateRepository();
+ mCertDB = mCA.getCertificateRepository();
}
X509CertImpl clientCert = (X509CertImpl) x509Certs[0];
@@ -121,7 +121,7 @@ public class SSLClientCertAuthentication implements IAuthManager {
BigInteger serialNum = null;
try {
- serialNum = (BigInteger) clientCert.getSerialNumber();
+ serialNum = clientCert.getSerialNumber();
//serialNum = new BigInteger(s.substring(2), 16);
} catch (NumberFormatException e) {
throw new EAuthUserError(CMS.getUserMessage("CMS_AUTHENTICATION_INVALID_ATTRIBUTE_VALUE",
@@ -134,7 +134,7 @@ public class SSLClientCertAuthentication implements IAuthManager {
ICertRecord record = null;
try {
- record = (ICertRecord) mCertDB.readCertificateRecord(serialNum);
+ record = mCertDB.readCertificateRecord(serialNum);
} catch (EBaseException ee) {
if (Debug.ON) {
Debug.trace(ee.toString());