diff options
author | Endi Sukma Dewata <edewata@redhat.com> | 2012-04-05 15:08:18 -0500 |
---|---|---|
committer | Endi Sukma Dewata <edewata@redhat.com> | 2012-04-09 10:22:03 -0500 |
commit | 3f24e55923fc986af4c6a08b2b8d45704a905627 (patch) | |
tree | 716415853b5676b801f6707634305b59b9af8603 /base/common/src/com/netscape/certsrv/base/Nonces.java | |
parent | 7c7b9d023cd466c1771068badc020dab36beb553 (diff) | |
download | pki-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/certsrv/base/Nonces.java')
-rw-r--r-- | base/common/src/com/netscape/certsrv/base/Nonces.java | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/base/common/src/com/netscape/certsrv/base/Nonces.java b/base/common/src/com/netscape/certsrv/base/Nonces.java index c041ec777..c28a74fae 100644 --- a/base/common/src/com/netscape/certsrv/base/Nonces.java +++ b/base/common/src/com/netscape/certsrv/base/Nonces.java @@ -48,17 +48,17 @@ public class Nonces { long i; long k = 0; long n = nonce; - long m = (long) ((mNonceLimit / 2) + 1); + long m = (mNonceLimit / 2) + 1; for (i = 0; i < m; i++) { k = n + i; // avoid collisions - if (!mNonceList.contains((Object) k)) { + if (!mNonceList.contains(k)) { break; } k = n - i; // avoid collisions - if (!mNonceList.contains((Object) k)) { + if (!mNonceList.contains(k)) { break; } } @@ -66,9 +66,9 @@ public class Nonces { mNonceList.add(k); mNonces.put(k, cert); if (mNonceList.size() > mNonceLimit) { - n = ((Long) (mNonceList.firstElement())).longValue(); + n = mNonceList.firstElement().longValue(); mNonceList.remove(0); - mNonces.remove((Object) n); + mNonces.remove(n); } } else { // failed to resolved collision @@ -78,15 +78,15 @@ public class Nonces { } public X509Certificate getCertificate(long nonce) { - X509Certificate cert = (X509Certificate) mNonces.get(nonce); + X509Certificate cert = mNonces.get(nonce); return cert; } public X509Certificate getCertificate(int index) { X509Certificate cert = null; if (index >= 0 && index < mNonceList.size()) { - long nonce = ((Long) (mNonceList.elementAt(index))).longValue(); - cert = (X509Certificate) mNonces.get(nonce); + long nonce = mNonceList.elementAt(index).longValue(); + cert = mNonces.get(nonce); } return cert; } @@ -94,14 +94,14 @@ public class Nonces { public long getNonce(int index) { long nonce = 0; if (index >= 0 && index < mNonceList.size()) { - nonce = ((Long) (mNonceList.elementAt(index))).longValue(); + nonce = mNonceList.elementAt(index).longValue(); } return nonce; } public void removeNonce(long nonce) { - mNonceList.remove((Object) nonce); - mNonces.remove((Object) nonce); + mNonceList.remove(nonce); + mNonces.remove(nonce); } public int size() { |