summaryrefslogtreecommitdiffstats
path: root/base/common/src/com/netscape/cms/profile
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/cms/profile
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/cms/profile')
-rw-r--r--base/common/src/com/netscape/cms/profile/common/CAEnrollProfile.java3
-rw-r--r--base/common/src/com/netscape/cms/profile/common/RAEnrollProfile.java2
-rw-r--r--base/common/src/com/netscape/cms/profile/constraint/UniqueKeyConstraint.java1
-rw-r--r--base/common/src/com/netscape/cms/profile/def/CertificatePoliciesExtDefault.java51
-rw-r--r--base/common/src/com/netscape/cms/profile/def/GenericExtDefault.java20
-rw-r--r--base/common/src/com/netscape/cms/profile/def/IssuerAltNameExtDefault.java2
-rw-r--r--base/common/src/com/netscape/cms/profile/def/NameConstraintsExtDefault.java2
-rw-r--r--base/common/src/com/netscape/cms/profile/def/PolicyMappingsExtDefault.java3
-rw-r--r--base/common/src/com/netscape/cms/profile/def/SubjectAltNameExtDefault.java2
-rw-r--r--base/common/src/com/netscape/cms/profile/def/SubjectDirAttributesExtDefault.java4
10 files changed, 39 insertions, 51 deletions
diff --git a/base/common/src/com/netscape/cms/profile/common/CAEnrollProfile.java b/base/common/src/com/netscape/cms/profile/common/CAEnrollProfile.java
index 46bc1a787..b44a71ee8 100644
--- a/base/common/src/com/netscape/cms/profile/common/CAEnrollProfile.java
+++ b/base/common/src/com/netscape/cms/profile/common/CAEnrollProfile.java
@@ -107,8 +107,7 @@ public class CAEnrollProfile extends EnrollProfile {
// do not archive keys for renewal requests
if ((optionsData != null) && (!request.getRequestType().equals(IRequest.RENEWAL_REQUEST))) {
- PKIArchiveOptions options = (PKIArchiveOptions)
- toPKIArchiveOptions(optionsData);
+ PKIArchiveOptions options = toPKIArchiveOptions(optionsData);
if (options != null) {
CMS.debug("CAEnrollProfile: execute found " +
diff --git a/base/common/src/com/netscape/cms/profile/common/RAEnrollProfile.java b/base/common/src/com/netscape/cms/profile/common/RAEnrollProfile.java
index 8bcb59c86..1fe2fa514 100644
--- a/base/common/src/com/netscape/cms/profile/common/RAEnrollProfile.java
+++ b/base/common/src/com/netscape/cms/profile/common/RAEnrollProfile.java
@@ -73,7 +73,7 @@ public class RAEnrollProfile extends EnrollProfile {
IRegistrationAuthority ra =
(IRegistrationAuthority) getAuthority();
- IRAService raService = (IRAService) ra.getRAService();
+ IRAService raService = ra.getRAService();
if (raService == null) {
throw new EProfileException("No RA Service");
diff --git a/base/common/src/com/netscape/cms/profile/constraint/UniqueKeyConstraint.java b/base/common/src/com/netscape/cms/profile/constraint/UniqueKeyConstraint.java
index 8d7a67a77..869f0e2cc 100644
--- a/base/common/src/com/netscape/cms/profile/constraint/UniqueKeyConstraint.java
+++ b/base/common/src/com/netscape/cms/profile/constraint/UniqueKeyConstraint.java
@@ -126,7 +126,6 @@ public class UniqueKeyConstraint extends EnrollConstraint {
String pub_s = escapeBinaryData(pub);
String filter = "(" + ICertRecord.ATTR_X509CERT_PUBLIC_KEY_DATA + "=" + pub_s + ")";
list =
- (ICertRecordList)
mCA.getCertificateRepository().findCertRecordsInList(filter, null, 10);
size = list.getSize();
diff --git a/base/common/src/com/netscape/cms/profile/def/CertificatePoliciesExtDefault.java b/base/common/src/com/netscape/cms/profile/def/CertificatePoliciesExtDefault.java
index e68ffca07..9629e4990 100644
--- a/base/common/src/com/netscape/cms/profile/def/CertificatePoliciesExtDefault.java
+++ b/base/common/src/com/netscape/cms/profile/def/CertificatePoliciesExtDefault.java
@@ -247,7 +247,7 @@ public class CertificatePoliciesExtDefault extends EnrollExtDefault {
StringTokenizer st = new StringTokenizer(value, "\r\n");
Hashtable<String, String> table = new Hashtable<String, String>();
while (st.hasMoreTokens()) {
- String token = (String) st.nextToken();
+ String token = st.nextToken();
int index = token.indexOf(":");
if (index <= 0)
throw new EPropertyException(CMS.getUserMessage(
@@ -287,15 +287,15 @@ public class CertificatePoliciesExtDefault extends EnrollExtDefault {
Hashtable<String, String> h = buildRecords(value);
- String numStr = (String) h.get(CONFIG_POLICY_NUM);
+ String numStr = h.get(CONFIG_POLICY_NUM);
int size = Integer.parseInt(numStr);
Vector<CertificatePolicyInfo> certificatePolicies = new Vector<CertificatePolicyInfo>();
for (int i = 0; i < size; i++) {
- String enable = (String) h.get(CONFIG_PREFIX + i + SEPARATOR + CONFIG_POLICY_ENABLE);
+ String enable = h.get(CONFIG_PREFIX + i + SEPARATOR + CONFIG_POLICY_ENABLE);
CertificatePolicyInfo cinfo = null;
if (enable != null && enable.equals("true")) {
- String policyId = (String) h.get(CONFIG_PREFIX + i + SEPARATOR + CONFIG_POLICY_ID);
+ String policyId = h.get(CONFIG_PREFIX + i + SEPARATOR + CONFIG_POLICY_ID);
if (policyId == null || policyId.length() == 0)
throw new EPropertyException(CMS.getUserMessage(
@@ -303,40 +303,39 @@ public class CertificatePoliciesExtDefault extends EnrollExtDefault {
CertificatePolicyId cpolicyId = getPolicyId(policyId);
String qualifersNum =
- (String) h.get(CONFIG_PREFIX + i + SEPARATOR + CONFIG_POLICY_QUALIFIERS_NUM);
+ h.get(CONFIG_PREFIX + i + SEPARATOR + CONFIG_POLICY_QUALIFIERS_NUM);
PolicyQualifiers policyQualifiers = new PolicyQualifiers();
int num = 0;
if (qualifersNum != null && qualifersNum.length() > 0)
num = Integer.parseInt(qualifersNum);
for (int j = 0; j < num; j++) {
String cpsuriEnable =
- (String) h.get(CONFIG_PREFIX
- + i + SEPARATOR + CONFIG_PREFIX1 + j + SEPARATOR + CONFIG_CPSURI_ENABLE);
+ h.get(CONFIG_PREFIX
+ + i + SEPARATOR + CONFIG_PREFIX1 + j + SEPARATOR + CONFIG_CPSURI_ENABLE);
String usernoticeEnable =
- (String) h
- .get(CONFIG_PREFIX
- + i + SEPARATOR + CONFIG_PREFIX1 + j + SEPARATOR
- + CONFIG_USERNOTICE_ENABLE);
+ h.get(CONFIG_PREFIX
+ + i + SEPARATOR + CONFIG_PREFIX1 + j + SEPARATOR
+ + CONFIG_USERNOTICE_ENABLE);
if (cpsuriEnable != null && cpsuriEnable.equals("true")) {
String cpsuri =
- (String) h.get(CONFIG_PREFIX
- + i + SEPARATOR + CONFIG_PREFIX1 + j + SEPARATOR + CONFIG_CPSURI_VALUE);
+ h.get(CONFIG_PREFIX
+ + i + SEPARATOR + CONFIG_PREFIX1 + j + SEPARATOR + CONFIG_CPSURI_VALUE);
netscape.security.x509.PolicyQualifierInfo qualifierInfo = createCPSuri(cpsuri);
if (qualifierInfo != null)
policyQualifiers.add(qualifierInfo);
} else if (usernoticeEnable != null && enable.equals("true")) {
String org =
- (String) h.get(CONFIG_PREFIX
- + i + SEPARATOR + CONFIG_PREFIX1 + j + SEPARATOR
- + CONFIG_USERNOTICE_ORG);
+ h.get(CONFIG_PREFIX
+ + i + SEPARATOR + CONFIG_PREFIX1 + j + SEPARATOR
+ + CONFIG_USERNOTICE_ORG);
String noticenumbers =
- (String) h.get(CONFIG_PREFIX
- + i + SEPARATOR + CONFIG_PREFIX1 + j + SEPARATOR
- + CONFIG_USERNOTICE_NUMBERS);
+ h.get(CONFIG_PREFIX
+ + i + SEPARATOR + CONFIG_PREFIX1 + j + SEPARATOR
+ + CONFIG_USERNOTICE_NUMBERS);
String explicitText =
- (String) h.get(CONFIG_PREFIX
- + i + SEPARATOR + CONFIG_PREFIX1 + j + SEPARATOR
- + CONFIG_USERNOTICE_TEXT);
+ h.get(CONFIG_PREFIX
+ + i + SEPARATOR + CONFIG_PREFIX1 + j + SEPARATOR
+ + CONFIG_USERNOTICE_TEXT);
netscape.security.x509.PolicyQualifierInfo qualifierInfo = createUserNotice(org,
noticenumbers, explicitText);
if (qualifierInfo != null)
@@ -345,11 +344,9 @@ public class CertificatePoliciesExtDefault extends EnrollExtDefault {
}
if (policyQualifiers.size() <= 0) {
- cinfo =
- new CertificatePolicyInfo(cpolicyId);
+ cinfo = new CertificatePolicyInfo(cpolicyId);
} else {
- cinfo =
- new CertificatePolicyInfo(cpolicyId, policyQualifiers);
+ cinfo = new CertificatePolicyInfo(cpolicyId, policyQualifiers);
}
if (cinfo != null)
certificatePolicies.addElement(cinfo);
@@ -762,7 +759,7 @@ public class CertificatePoliciesExtDefault extends EnrollExtDefault {
nums = new int[numsVector.size()];
try {
for (int i = 0; i < numsVector.size(); i++) {
- Integer ii = new Integer((String) numsVector.elementAt(i));
+ Integer ii = new Integer(numsVector.elementAt(i));
nums[i] = ii.intValue();
}
} catch (Exception e) {
diff --git a/base/common/src/com/netscape/cms/profile/def/GenericExtDefault.java b/base/common/src/com/netscape/cms/profile/def/GenericExtDefault.java
index d5d88c29e..4a8acace1 100644
--- a/base/common/src/com/netscape/cms/profile/def/GenericExtDefault.java
+++ b/base/common/src/com/netscape/cms/profile/def/GenericExtDefault.java
@@ -109,24 +109,21 @@ public class GenericExtDefault extends EnrollExtDefault {
ObjectIdentifier oid = new ObjectIdentifier(getConfig(CONFIG_OID));
- ext = (Extension)
- getExtension(oid.toString(), info);
+ ext = getExtension(oid.toString(), info);
if (ext == null) {
populate(null, info);
}
if (name.equals(VAL_CRITICAL)) {
- ext = (Extension)
- getExtension(oid.toString(), info);
+ ext = getExtension(oid.toString(), info);
if (ext == null) {
return;
}
boolean val = Boolean.valueOf(value).booleanValue();
ext.setCritical(val);
} else if (name.equals(VAL_DATA)) {
- ext = (Extension)
- getExtension(oid.toString(), info);
+ ext = getExtension(oid.toString(), info);
if (ext == null) {
return;
}
@@ -155,8 +152,7 @@ public class GenericExtDefault extends EnrollExtDefault {
ObjectIdentifier oid = new ObjectIdentifier(getConfig(CONFIG_OID));
- ext = (Extension)
- getExtension(oid.toString(), info);
+ ext = getExtension(oid.toString(), info);
if (ext == null) {
try {
@@ -171,8 +167,7 @@ public class GenericExtDefault extends EnrollExtDefault {
if (name.equals(VAL_CRITICAL)) {
- ext = (Extension)
- getExtension(oid.toString(), info);
+ ext = getExtension(oid.toString(), info);
if (ext == null) {
return null;
@@ -184,8 +179,7 @@ public class GenericExtDefault extends EnrollExtDefault {
}
} else if (name.equals(VAL_DATA)) {
- ext = (Extension)
- getExtension(oid.toString(), info);
+ ext = getExtension(oid.toString(), info);
if (ext == null)
return "";
@@ -218,7 +212,7 @@ public class GenericExtDefault extends EnrollExtDefault {
if ((data[i] & 0xff) < 16) {
b.append("0");
}
- b.append(Integer.toString((int) (data[i] & 0xff), 0x10));
+ b.append(Integer.toString((data[i] & 0xff), 0x10));
}
return b.toString();
}
diff --git a/base/common/src/com/netscape/cms/profile/def/IssuerAltNameExtDefault.java b/base/common/src/com/netscape/cms/profile/def/IssuerAltNameExtDefault.java
index 3feddd628..ec203713b 100644
--- a/base/common/src/com/netscape/cms/profile/def/IssuerAltNameExtDefault.java
+++ b/base/common/src/com/netscape/cms/profile/def/IssuerAltNameExtDefault.java
@@ -160,7 +160,7 @@ public class IssuerAltNameExtDefault extends EnrollExtDefault {
StringTokenizer st = new StringTokenizer(value, "\r\n");
while (st.hasMoreTokens()) {
- String gname = (String) st.nextToken();
+ String gname = st.nextToken();
GeneralNameInterface n = parseGeneralName(gname);
if (n != null) {
diff --git a/base/common/src/com/netscape/cms/profile/def/NameConstraintsExtDefault.java b/base/common/src/com/netscape/cms/profile/def/NameConstraintsExtDefault.java
index 929878de3..f010b6134 100644
--- a/base/common/src/com/netscape/cms/profile/def/NameConstraintsExtDefault.java
+++ b/base/common/src/com/netscape/cms/profile/def/NameConstraintsExtDefault.java
@@ -516,7 +516,7 @@ public class NameConstraintsExtDefault extends EnrollExtDefault {
Vector<NameValuePairs> recs = new Vector<NameValuePairs>();
for (int i = 0; i < size; i++) {
- GeneralSubtree tree = (GeneralSubtree) trees.elementAt(i);
+ GeneralSubtree tree = trees.elementAt(i);
GeneralName gn = tree.getGeneralName();
String type = getGeneralNameType(gn);
diff --git a/base/common/src/com/netscape/cms/profile/def/PolicyMappingsExtDefault.java b/base/common/src/com/netscape/cms/profile/def/PolicyMappingsExtDefault.java
index 55a9e420e..56d67a93e 100644
--- a/base/common/src/com/netscape/cms/profile/def/PolicyMappingsExtDefault.java
+++ b/base/common/src/com/netscape/cms/profile/def/PolicyMappingsExtDefault.java
@@ -316,8 +316,7 @@ public class PolicyMappingsExtDefault extends EnrollExtDefault {
NameValuePairs pairs = new NameValuePairs();
if (maps.hasMoreElements()) {
- CertificatePolicyMap map =
- (CertificatePolicyMap) maps.nextElement();
+ CertificatePolicyMap map = maps.nextElement();
CertificatePolicyId i1 = map.getIssuerIdentifier();
CertificatePolicyId s1 = map.getSubjectIdentifier();
diff --git a/base/common/src/com/netscape/cms/profile/def/SubjectAltNameExtDefault.java b/base/common/src/com/netscape/cms/profile/def/SubjectAltNameExtDefault.java
index 0aa92937f..4bb1d0309 100644
--- a/base/common/src/com/netscape/cms/profile/def/SubjectAltNameExtDefault.java
+++ b/base/common/src/com/netscape/cms/profile/def/SubjectAltNameExtDefault.java
@@ -268,7 +268,7 @@ public class SubjectAltNameExtDefault extends EnrollExtDefault {
StringTokenizer st = new StringTokenizer(value, "\r\n");
while (st.hasMoreTokens()) {
- String gname = (String) st.nextToken();
+ String gname = st.nextToken();
CMS.debug("SubjectAltNameExtDefault: setValue GN:" + gname);
if (!isGeneralNameValid(gname)) {
diff --git a/base/common/src/com/netscape/cms/profile/def/SubjectDirAttributesExtDefault.java b/base/common/src/com/netscape/cms/profile/def/SubjectDirAttributesExtDefault.java
index 813e92a28..a60721733 100644
--- a/base/common/src/com/netscape/cms/profile/def/SubjectDirAttributesExtDefault.java
+++ b/base/common/src/com/netscape/cms/profile/def/SubjectDirAttributesExtDefault.java
@@ -333,10 +333,10 @@ public class SubjectDirAttributesExtDefault extends EnrollExtDefault {
StringBuffer ss = new StringBuffer();
while (v.hasMoreElements()) {
if (ss.length() == 0)
- ss.append((String) (v.nextElement()));
+ ss.append(v.nextElement());
else {
ss.append(",");
- ss.append((String) (v.nextElement()));
+ ss.append(v.nextElement());
}
}