SWS-918 Fix compiler warnings
The project contains various easy to fix compiler warnings like unused
imports, raw types and no longer needed @SuppressWarnings("unchecked").
This change removes:
* unused imports
* raw types
* no longer needed @SuppressWarnings("unchecked")
Issue: SWS-918
https://jira.spring.io/browse/SWS-918
This commit is contained in:
@@ -45,7 +45,7 @@ public class JaxbElementPayloadMethodProcessor extends AbstractJaxb2PayloadMetho
|
||||
public JAXBElement<?> resolveArgument(MessageContext messageContext, MethodParameter parameter)
|
||||
throws JAXBException {
|
||||
ParameterizedType parameterizedType = (ParameterizedType) parameter.getGenericParameterType();
|
||||
Class<?> clazz = (Class) parameterizedType.getActualTypeArguments()[0];
|
||||
Class<?> clazz = (Class<?>) parameterizedType.getActualTypeArguments()[0];
|
||||
return unmarshalElementFromRequestPayload(messageContext, clazz);
|
||||
}
|
||||
|
||||
|
||||
@@ -105,13 +105,11 @@ public class HttpServletConnection extends AbstractReceiverConnection
|
||||
*/
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public Iterator<String> getRequestHeaderNames() throws IOException {
|
||||
return new EnumerationIterator<String>(getHttpServletRequest().getHeaderNames());
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public Iterator<String> getRequestHeaders(String name) throws IOException {
|
||||
return new EnumerationIterator<String>(getHttpServletRequest().getHeaders(name));
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class DummyMarshaller implements Marshaller, Unmarshaller {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supports(Class clazz) {
|
||||
public boolean supports(Class<?> clazz) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
|
||||
@@ -233,7 +233,7 @@ public class AxiomHandlerTest {
|
||||
|
||||
private int getNamespaceCount(OMElement element) {
|
||||
int i = 0;
|
||||
Iterator namespaces = element.getAllDeclaredNamespaces();
|
||||
Iterator<?> namespaces = element.getAllDeclaredNamespaces();
|
||||
while (namespaces.hasNext()) {
|
||||
namespaces.next();
|
||||
i++;
|
||||
|
||||
@@ -127,7 +127,7 @@ public class SoapHeaderElementMethodArgumentResolverTest extends AbstractMethodA
|
||||
public void resolveSoapHeaderMismatchList() throws Exception {
|
||||
Object result = resolver.resolveArgument(messageContext, soapHeaderMismatchList);
|
||||
assertTrue("result must be a List", List.class.isAssignableFrom(result.getClass()));
|
||||
assertTrue("result List must be empty", ((List) result).isEmpty());
|
||||
assertTrue("result List must be empty", ((List<?>) result).isEmpty());
|
||||
}
|
||||
|
||||
public void soapHeaderWithEmptyValue(@SoapHeader("") SoapHeaderElement element) {
|
||||
|
||||
@@ -20,9 +20,6 @@ import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.soap.MessageFactory;
|
||||
import javax.xml.soap.SOAPConstants;
|
||||
import javax.xml.soap.SOAPMessage;
|
||||
import javax.xml.transform.dom.DOMResult;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
|
||||
@@ -33,7 +30,6 @@ import org.springframework.core.io.Resource;
|
||||
import org.springframework.ws.soap.AbstractSoapMessageTestCase;
|
||||
import org.springframework.ws.soap.SoapBody;
|
||||
import org.springframework.ws.soap.SoapVersion;
|
||||
import org.springframework.ws.soap.saaj.SaajSoapMessage;
|
||||
import org.springframework.ws.transport.MockTransportOutputStream;
|
||||
import org.springframework.ws.transport.TransportConstants;
|
||||
import org.springframework.xml.transform.StringSource;
|
||||
|
||||
@@ -38,7 +38,6 @@ public abstract class SpringSecurityUtils {
|
||||
* @throws DisabledException if the account is disabled
|
||||
* @throws LockedException if the account is locked
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public static void checkUserValidity(UserDetails user)
|
||||
throws AccountExpiredException, CredentialsExpiredException, DisabledException, LockedException {
|
||||
if (!user.isAccountNonLocked()) {
|
||||
|
||||
@@ -597,7 +597,6 @@ public class Wss4jSecurityInterceptor extends AbstractWsSecurityInterceptor impl
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
protected void validateMessage(SoapMessage soapMessage, MessageContext messageContext)
|
||||
throws WsSecurityValidationException {
|
||||
if (logger.isDebugEnabled()) {
|
||||
|
||||
@@ -17,10 +17,8 @@
|
||||
package org.springframework.ws.soap.security.support;
|
||||
|
||||
import javax.net.ssl.KeyManager;
|
||||
import javax.net.ssl.TrustManager;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ package org.springframework.ws.soap.security.support;
|
||||
import javax.net.ssl.TrustManager;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@ package org.springframework.ws.soap.security.xwss.callback.jaas;
|
||||
|
||||
import java.security.Principal;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.security.auth.Subject;
|
||||
import javax.security.auth.callback.CallbackHandler;
|
||||
import javax.security.auth.login.LoginException;
|
||||
@@ -48,8 +50,8 @@ public class CertificateLoginModule implements LoginModule {
|
||||
@Override
|
||||
public void initialize(Subject subject,
|
||||
CallbackHandler callbackHandler,
|
||||
java.util.Map sharedState,
|
||||
java.util.Map options) {
|
||||
Map<String,?> sharedState,
|
||||
Map<String,?> options) {
|
||||
this.subject = subject;
|
||||
}
|
||||
|
||||
@@ -73,8 +75,8 @@ public class CertificateLoginModule implements LoginModule {
|
||||
}
|
||||
|
||||
private String getName(Subject subject) {
|
||||
for (Iterator iterator = subject.getPrincipals().iterator(); iterator.hasNext();) {
|
||||
Principal principal = (Principal) iterator.next();
|
||||
for (Iterator<Principal> iterator = subject.getPrincipals().iterator(); iterator.hasNext();) {
|
||||
Principal principal = iterator.next();
|
||||
if (principal instanceof X500Principal) {
|
||||
return principal.getName();
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@ import java.security.Principal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.security.auth.Subject;
|
||||
import javax.security.auth.callback.Callback;
|
||||
import javax.security.auth.callback.CallbackHandler;
|
||||
@@ -69,8 +71,8 @@ public class PlainTextLoginModule implements LoginModule {
|
||||
@Override
|
||||
public void initialize(Subject subject,
|
||||
CallbackHandler callbackHandler,
|
||||
java.util.Map sharedState,
|
||||
java.util.Map options) {
|
||||
Map<String,?> sharedState,
|
||||
Map<String,?> options) {
|
||||
this.subject = subject;
|
||||
this.callbackHandler = callbackHandler;
|
||||
}
|
||||
@@ -126,9 +128,9 @@ public class PlainTextLoginModule implements LoginModule {
|
||||
public boolean logout() {
|
||||
principals.clear();
|
||||
|
||||
Iterator iterator = subject.getPrincipals(SimplePrincipal.class).iterator();
|
||||
Iterator<SimplePrincipal> iterator = subject.getPrincipals(SimplePrincipal.class).iterator();
|
||||
while (iterator.hasNext()) {
|
||||
SimplePrincipal principal = (SimplePrincipal) iterator.next();
|
||||
SimplePrincipal principal = iterator.next();
|
||||
subject.getPrincipals().remove(principal);
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,6 @@ class MockSenderConnection implements WebServiceConnection, ResponseActions {
|
||||
// FaultAwareWebServiceConnection implementation
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void send(WebServiceMessage message) throws IOException {
|
||||
if (!requestMatchers.isEmpty()) {
|
||||
for (RequestMatcher requestMatcher : requestMatchers) {
|
||||
@@ -84,7 +83,6 @@ class MockSenderConnection implements WebServiceConnection, ResponseActions {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public WebServiceMessage receive(WebServiceMessageFactory messageFactory) throws IOException {
|
||||
if (responseCreator != null) {
|
||||
return responseCreator.createResponse(uri, request, messageFactory);
|
||||
|
||||
@@ -18,7 +18,6 @@ package org.springframework.ws.test.support.matcher;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.springframework.core.io.ByteArrayResource;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.ws.WebServiceMessage;
|
||||
|
||||
Reference in New Issue
Block a user