summaryrefslogtreecommitdiffstats
path: root/base/java-tools
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/java-tools
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/java-tools')
-rw-r--r--base/java-tools/src/com/netscape/cmstools/AuditVerify.java4
-rw-r--r--base/java-tools/src/com/netscape/cmstools/CMCEnroll.java3
-rw-r--r--base/java-tools/src/com/netscape/cmstools/CMCRequest.java9
-rw-r--r--base/java-tools/src/com/netscape/cmstools/DRMTool.java5
-rw-r--r--base/java-tools/src/com/netscape/cmstools/PasswordCache.java6
5 files changed, 12 insertions, 15 deletions
diff --git a/base/java-tools/src/com/netscape/cmstools/AuditVerify.java b/base/java-tools/src/com/netscape/cmstools/AuditVerify.java
index 8e9be012d..fb92cf12c 100644
--- a/base/java-tools/src/com/netscape/cmstools/AuditVerify.java
+++ b/base/java-tools/src/com/netscape/cmstools/AuditVerify.java
@@ -229,12 +229,12 @@ public class AuditVerify {
int sigStartLine = 1;
int sigStopLine = 1;
- String sigStartFile = (String) logFiles.elementAt(0);
+ String sigStartFile = logFiles.elementAt(0);
String sigStopFile = null;
int signedLines = 1;
for (int curfile = 0; curfile < logFiles.size(); ++curfile) {
- String curfileName = (String) logFiles.elementAt(curfile);
+ String curfileName = logFiles.elementAt(curfile);
BufferedReader br = new BufferedReader(new FileReader(curfileName));
if (verbose) {
diff --git a/base/java-tools/src/com/netscape/cmstools/CMCEnroll.java b/base/java-tools/src/com/netscape/cmstools/CMCEnroll.java
index 84b92e48c..b7955d70b 100644
--- a/base/java-tools/src/com/netscape/cmstools/CMCEnroll.java
+++ b/base/java-tools/src/com/netscape/cmstools/CMCEnroll.java
@@ -26,7 +26,6 @@ import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
-import java.io.OutputStream;
import java.io.PrintStream;
import java.math.BigInteger;
import java.security.MessageDigest;
@@ -250,7 +249,7 @@ public class CMCEnroll {
ByteArrayOutputStream ostream = new ByteArrayOutputStream();
- pkidata.encode((OutputStream) ostream);
+ pkidata.encode(ostream);
digest = SHADigest.digest(ostream.toByteArray());
} catch (NoSuchAlgorithmException e) {
}
diff --git a/base/java-tools/src/com/netscape/cmstools/CMCRequest.java b/base/java-tools/src/com/netscape/cmstools/CMCRequest.java
index f77bc039d..1dfb36fb2 100644
--- a/base/java-tools/src/com/netscape/cmstools/CMCRequest.java
+++ b/base/java-tools/src/com/netscape/cmstools/CMCRequest.java
@@ -26,7 +26,6 @@ import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
-import java.io.OutputStream;
import java.io.PrintStream;
import java.math.BigInteger;
import java.security.MessageDigest;
@@ -259,7 +258,7 @@ public class CMCRequest {
ByteArrayOutputStream ostream = new ByteArrayOutputStream();
- pkidata.encode((OutputStream) ostream);
+ pkidata.encode(ostream);
digest = SHADigest.digest(ostream.toByteArray());
} catch (NoSuchAlgorithmException e) {
}
@@ -444,7 +443,7 @@ public class CMCRequest {
StringTokenizer tokenizer = new StringTokenizer(bodyPartIDs, " ");
SEQUENCE bodyList = new SEQUENCE();
while (tokenizer.hasMoreTokens()) {
- String s = (String) tokenizer.nextToken();
+ String s = tokenizer.nextToken();
bodyList.addElement(new INTEGER(s));
}
LraPopWitness lra = new LraPopWitness(new INTEGER(0), bodyList);
@@ -602,7 +601,7 @@ public class CMCRequest {
ByteArrayOutputStream ostream = new ByteArrayOutputStream();
- revRequestControl.encode((OutputStream) ostream);
+ revRequestControl.encode(ostream);
rdigest = rSHADigest.digest(ostream.toByteArray());
} catch (NoSuchAlgorithmException e) {
}
@@ -942,7 +941,7 @@ public class CMCRequest {
StringTokenizer tokenizer = new StringTokenizer(ifilename, " ");
String[] ifiles = new String[num];
for (int i = 0; i < num; i++) {
- String ss = (String) tokenizer.nextToken();
+ String ss = tokenizer.nextToken();
ifiles[i] = ss;
if (ss == null) {
System.out.println("Missing input file for the request.");
diff --git a/base/java-tools/src/com/netscape/cmstools/DRMTool.java b/base/java-tools/src/com/netscape/cmstools/DRMTool.java
index c536466c6..be6b10afc 100644
--- a/base/java-tools/src/com/netscape/cmstools/DRMTool.java
+++ b/base/java-tools/src/com/netscape/cmstools/DRMTool.java
@@ -1762,9 +1762,8 @@ public class DRMTool {
+ "the target storage certificate . . ."
+ NEWLINE, true);
- mWrapPublicKey = (PublicKey)
- (PK11PubKey.fromSPKI(
- getPublicKey().getEncoded()));
+ mWrapPublicKey = PK11PubKey.fromSPKI(
+ getPublicKey().getEncoded());
if (mWrapPublicKey == null) {
log("ERROR: Failed extracting "
diff --git a/base/java-tools/src/com/netscape/cmstools/PasswordCache.java b/base/java-tools/src/com/netscape/cmstools/PasswordCache.java
index cdddb5f1e..dbd8a21f3 100644
--- a/base/java-tools/src/com/netscape/cmstools/PasswordCache.java
+++ b/base/java-tools/src/com/netscape/cmstools/PasswordCache.java
@@ -696,7 +696,7 @@ class PWsdrCache {
StringTokenizer st = new StringTokenizer(cache, "\n");
while (st.hasMoreTokens()) {
- String line = (String) st.nextToken();
+ String line = st.nextToken();
// break into tag:password format for each line
int colonIdx = line.indexOf(":");
@@ -752,7 +752,7 @@ class PWsdrCache {
// this is created and destroyed at each use
pwTable = string2Hashtable(cache);
debug("in getEntry, pw cache parsed");
- pw = (String) pwTable.get(tag);
+ pw = pwTable.get(tag);
}
if (pw != null) {
@@ -848,7 +848,7 @@ class PWsdrCache {
StringTokenizer st = new StringTokenizer(dcrypts, "\n");
while (st.hasMoreTokens()) {
- String line = (String) st.nextToken();
+ String line = st.nextToken();
// break into tag:password format for each line
int colonIdx = line.indexOf(":");