Commit 52dfe9ec authored by Christian Schudt's avatar Christian Schudt

Remove redundant type casts.

parent dfb69a76
...@@ -122,8 +122,8 @@ public class JMXManager { ...@@ -122,8 +122,8 @@ public class JMXManager {
if (aCredentials.length < 2) { if (aCredentials.length < 2) {
throw new SecurityException("Credentials should have at least two elements"); throw new SecurityException("Credentials should have at least two elements");
} }
String username = (String) aCredentials[0]; String username = aCredentials[0];
String password = (String) aCredentials[1]; String password = aCredentials[1];
try { try {
AuthFactory.authenticate(username, password); AuthFactory.authenticate(username, password);
......
...@@ -195,7 +195,7 @@ public class MulticastRouter extends BasicModule implements ServerFeaturesProvid ...@@ -195,7 +195,7 @@ public class MulticastRouter extends BasicModule implements ServerFeaturesProvid
*/ */
private void sendToRemoteEntity(String domain) { private void sendToRemoteEntity(String domain) {
// Check if there is cached information about the requested domain // Check if there is cached information about the requested domain
String multicastService = (String) cache.get(domain); String multicastService = cache.get(domain);
if (multicastService != null) { if (multicastService != null) {
sendToRemoteServer(domain, multicastService); sendToRemoteServer(domain, multicastService);
} }
......
...@@ -365,7 +365,7 @@ public class XMPPServer { ...@@ -365,7 +365,7 @@ public class XMPPServer {
// Iterate through all the provided XML properties and set the ones that haven't // Iterate through all the provided XML properties and set the ones that haven't
// already been touched by setup prior to this method being called. // already been touched by setup prior to this method being called.
for (String propName : (List<String>)JiveGlobals.getXMLPropertyNames()) { for (String propName : JiveGlobals.getXMLPropertyNames()) {
if (JiveGlobals.getProperty(propName) == null) { if (JiveGlobals.getProperty(propName) == null) {
JiveGlobals.setProperty(propName, JiveGlobals.getXMLProperty(propName)); JiveGlobals.setProperty(propName, JiveGlobals.getXMLProperty(propName));
} }
......
...@@ -150,7 +150,7 @@ public class POP3AuthProvider implements AuthProvider { ...@@ -150,7 +150,7 @@ public class POP3AuthProvider implements AuthProvider {
// If cache is enabled, see if the auth is in cache. // If cache is enabled, see if the auth is in cache.
if (authCache != null && authCache.containsKey(username)) { if (authCache != null && authCache.containsKey(username)) {
String hash = (String)authCache.get(username); String hash = authCache.get(username);
if (StringUtils.hash(password).equals(hash)) { if (StringUtils.hash(password).equals(hash)) {
return; return;
} }
......
...@@ -355,7 +355,7 @@ public final class GraphicUtils { ...@@ -355,7 +355,7 @@ public final class GraphicUtils {
return null; return null;
} }
Image image = (Image) imageCache.get(url.toString()); Image image = imageCache.get(url.toString());
if (image == null) { if (image == null) {
image = Toolkit.getDefaultToolkit().createImage(url); image = Toolkit.getDefaultToolkit().createImage(url);
......
...@@ -303,7 +303,7 @@ public class ClientTrustManager implements X509TrustManager { ...@@ -303,7 +303,7 @@ public class ClientTrustManager implements X509TrustManager {
params.addCertPathChecker(ocspChecker); params.addCertPathChecker(ocspChecker);
} }
PKIXCertPathValidatorResult cpvResult = (PKIXCertPathValidatorResult) cpv.validate(cp, params); PKIXCertPathValidatorResult cpvResult = (PKIXCertPathValidatorResult) cpv.validate(cp, params);
X509Certificate trustedCert = (X509Certificate) cpvResult.getTrustAnchor().getTrustedCert(); X509Certificate trustedCert = cpvResult.getTrustAnchor().getTrustedCert();
if(trustedCert == null) { if(trustedCert == null) {
throw new CertificateException("certificate path failed: Trusted CA is NULL"); throw new CertificateException("certificate path failed: Trusted CA is NULL");
} else { } else {
......
...@@ -132,7 +132,7 @@ public class OCSPChecker extends PKIXCertPathChecker { ...@@ -132,7 +132,7 @@ public class OCSPChecker extends PKIXCertPathChecker {
// Set the issuer certificate if we were passed a chain // Set the issuer certificate if we were passed a chain
if (certIndex != 0) { if (certIndex != 0) {
issuerCert = (X509Certificate) (certs[certIndex]); issuerCert = certs[certIndex];
haveIssuerCert = true; haveIssuerCert = true;
if (haveResponderCert) { if (haveResponderCert) {
......
...@@ -581,7 +581,7 @@ public class SASLAuthentication { ...@@ -581,7 +581,7 @@ public class SASLAuthentication {
authenticationFailed(session, Failure.NOT_AUTHORIZED); authenticationFailed(session, Failure.NOT_AUTHORIZED);
return Status.failed; return Status.failed;
} }
principals.addAll(CertificateManager.getClientIdentities((X509Certificate)trusted)); principals.addAll(CertificateManager.getClientIdentities(trusted));
if(principals.size() == 1) { if(principals.size() == 1) {
principal = principals.get(0); principal = principals.get(0);
......
...@@ -481,7 +481,7 @@ public class PEPService implements PubSubService, Cacheable { ...@@ -481,7 +481,7 @@ public class PEPService implements PubSubService, Cacheable {
Element items = event.addElement("items"); Element items = event.addElement("items");
items.addAttribute("node", leafLastPublishedItem.getNodeID()); items.addAttribute("node", leafLastPublishedItem.getNodeID());
Element item = items.addElement("item"); Element item = items.addElement("item");
if (((LeafNode) leafLastPublishedItem.getNode()).isItemRequired()) { if (leafLastPublishedItem.getNode().isItemRequired()) {
item.addAttribute("id", leafLastPublishedItem.getID()); item.addAttribute("id", leafLastPublishedItem.getID());
} }
if (leafLastPublishedItem.getNode().isPayloadDelivered() && leafLastPublishedItem.getPayload() != null) { if (leafLastPublishedItem.getNode().isPayloadDelivered() && leafLastPublishedItem.getPayload() != null) {
......
...@@ -52,7 +52,7 @@ public class VerifyPasswordCallback implements Callback, Serializable { ...@@ -52,7 +52,7 @@ public class VerifyPasswordCallback implements Callback, Serializable {
* @param password the password to verify. * @param password the password to verify.
*/ */
public VerifyPasswordCallback(char[] password) { public VerifyPasswordCallback(char[] password) {
this.password = (password == null ? null : (char[])password.clone()); this.password = (password == null ? null : password.clone());
this.verified = false; this.verified = false;
} }
...@@ -61,7 +61,7 @@ public class VerifyPasswordCallback implements Callback, Serializable { ...@@ -61,7 +61,7 @@ public class VerifyPasswordCallback implements Callback, Serializable {
* @return the retrieved password, which may be null. * @return the retrieved password, which may be null.
*/ */
public char[] getPassword() { public char[] getPassword() {
return (password == null ? null : (char[])password.clone()); return (password == null ? null : password.clone());
} }
/** /**
......
...@@ -211,7 +211,7 @@ public class FastDateFormat { ...@@ -211,7 +211,7 @@ public class FastDateFormat {
key = new Pair(key, locale); key = new Pair(key, locale);
} }
FastDateFormat format = (FastDateFormat)cDateInstanceCache.get(key); FastDateFormat format = cDateInstanceCache.get(key);
if (format == null) { if (format == null) {
int ds; int ds;
......
...@@ -57,8 +57,8 @@ public abstract class WebBean { ...@@ -57,8 +57,8 @@ public abstract class WebBean {
public void init(PageContext pageContext){ public void init(PageContext pageContext){
this.request = (HttpServletRequest)pageContext.getRequest(); this.request = (HttpServletRequest)pageContext.getRequest();
this.response = (HttpServletResponse)pageContext.getResponse(); this.response = (HttpServletResponse)pageContext.getResponse();
this.session = (HttpSession)pageContext.getSession(); this.session = pageContext.getSession();
this.application = (ServletContext)pageContext.getServletContext(); this.application = pageContext.getServletContext();
this.out = (JspWriter)pageContext.getOut(); this.out = pageContext.getOut();
} }
} }
\ No newline at end of file
...@@ -464,7 +464,7 @@ public class XMLProperties { ...@@ -464,7 +464,7 @@ public class XMLProperties {
toRemove.add(iter.next()); toRemove.add(iter.next());
} }
for (iter = toRemove.iterator(); iter.hasNext();) { for (iter = toRemove.iterator(); iter.hasNext();) {
element.remove((Element)iter.next()); element.remove(iter.next());
} }
// Add the new children. // Add the new children.
for (String value : values) { for (String value : values) {
......
...@@ -810,7 +810,7 @@ public class XMLWriter extends XMLFilterImpl implements LexicalHandler { ...@@ -810,7 +810,7 @@ public class XMLWriter extends XMLFilterImpl implements LexicalHandler {
* If it does, then retain whitespace. * If it does, then retain whitespace.
*/ */
protected final boolean isElementSpacePreserved(Element element) { protected final boolean isElementSpacePreserved(Element element) {
final Attribute attr = (Attribute)element.attribute("space"); final Attribute attr = element.attribute("space");
boolean preserveFound=preserve; //default to global state boolean preserveFound=preserve; //default to global state
if (attr!=null) { if (attr!=null) {
if ("xml".equals(attr.getNamespacePrefix()) && if ("xml".equals(attr.getNamespacePrefix()) &&
...@@ -852,7 +852,7 @@ public class XMLWriter extends XMLFilterImpl implements LexicalHandler { ...@@ -852,7 +852,7 @@ public class XMLWriter extends XMLFilterImpl implements LexicalHandler {
if (buffer == null) { if (buffer == null) {
buffer = new StringBuilder( lastTextNode.getText() ); buffer = new StringBuilder( lastTextNode.getText() );
} }
buffer.append( ((Text) node).getText() ); buffer.append( node.getText() );
} }
} }
else { else {
......
...@@ -32,7 +32,7 @@ public class AdminConsoleTest { ...@@ -32,7 +32,7 @@ public class AdminConsoleTest {
Class c = AdminConsole.class; Class c = AdminConsole.class;
Method init = c.getDeclaredMethod("load", (Class[])null); Method init = c.getDeclaredMethod("load", (Class[])null);
init.setAccessible(true); init.setAccessible(true);
init.invoke((Object)null, (Object[])null); init.invoke(null, (Object[])null);
} }
@Test @Test
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment