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

Remove redundant type casts.

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