From 3f24e55923fc986af4c6a08b2b8d45704a905627 Mon Sep 17 00:00:00 2001 From: Endi Sukma Dewata Date: Thu, 5 Apr 2012 15:08:18 -0500 Subject: Removed unnecessary type casts. Unnecessary type casts have been removed using Eclipse Quick Fix. Ticket #134 --- .../src/com/netscape/certsrv/base/Nonces.java | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'base/common/src/com/netscape/certsrv/base/Nonces.java') 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() { -- cgit