From 12a10a34f132b233d83aff7147decb918ee2bddd Mon Sep 17 00:00:00 2001 From: Arjen Poutsma Date: Thu, 24 Apr 2014 14:13:23 +0200 Subject: [PATCH] Bumped up compile warnings Bumped up the compiler warning to errors. --- build.gradle | 34 ++++++-------- .../ws/InvalidXmlException.java | 5 +- .../ws/NoEndpointFoundException.java | 3 +- .../ws/WebServiceException.java | 3 +- .../ws/WebServiceMessageException.java | 3 +- .../ws/client/WebServiceClientException.java | 3 +- .../ws/client/WebServiceFaultException.java | 3 +- .../ws/client/WebServiceIOException.java | 3 +- .../WebServiceTransformerException.java | 3 +- .../client/WebServiceTransportException.java | 3 +- .../DestinationProvisionException.java | 3 +- .../WebServiceValidationException.java | 7 +-- .../config/WebServicesNamespaceHandler.java | 1 + .../ws/mime/AttachmentException.java | 3 +- .../ws/pox/PoxMessageException.java | 3 +- .../ws/pox/dom/DomPoxMessageException.java | 3 +- ...tValidatingMarshallingPayloadEndpoint.java | 4 +- .../endpoint/AbstractXomPayloadEndpoint.java | 1 + .../XPathParamMethodArgumentResolver.java | 3 +- .../AbstractJaxb2PayloadMethodProcessor.java | 2 +- .../ws/soap/SoapBodyException.java | 3 +- .../ws/soap/SoapElementException.java | 3 +- .../ws/soap/SoapEnvelopeException.java | 3 +- .../ws/soap/SoapFaultException.java | 3 +- .../ws/soap/SoapHeaderException.java | 3 +- .../ws/soap/SoapMessageCreationException.java | 3 +- .../ws/soap/SoapMessageException.java | 3 +- .../soap/addressing/AddressingException.java | 3 +- .../server/SimpleActionEndpointMapping.java | 4 +- .../version/AbstractAddressingVersion.java | 23 +++++----- .../soap/addressing/version/Addressing10.java | 6 +-- .../addressing/version/Addressing200408.java | 7 +-- .../soap/axiom/AxiomAttachmentException.java | 3 +- .../ws/soap/axiom/AxiomSoap11Body.java | 10 ++-- .../ws/soap/axiom/AxiomSoap12Fault.java | 6 +-- .../ws/soap/axiom/AxiomSoap12Header.java | 6 +-- .../ws/soap/axiom/AxiomSoapBodyException.java | 3 +- .../soap/axiom/AxiomSoapElementException.java | 3 +- .../axiom/AxiomSoapEnvelopeException.java | 3 +- .../ws/soap/axiom/AxiomSoapFaultDetail.java | 1 + .../soap/axiom/AxiomSoapFaultException.java | 3 +- .../ws/soap/axiom/AxiomSoapHeader.java | 6 +-- .../soap/axiom/AxiomSoapHeaderException.java | 3 +- .../AxiomSoapMessageCreationException.java | 3 +- .../soap/axiom/AxiomSoapMessageException.java | 3 +- .../soap/axiom/AxiomSoapMessageFactory.java | 8 ++-- .../ws/soap/axiom/support/AxiomUtils.java | 13 +++--- .../soap/client/SoapFaultClientException.java | 3 +- .../ws/soap/saaj/SaajAttachmentException.java | 3 +- .../ws/soap/saaj/SaajSoap11Header.java | 1 + .../ws/soap/saaj/SaajSoap12Fault.java | 1 + .../ws/soap/saaj/SaajSoap12Header.java | 1 + .../ws/soap/saaj/SaajSoapBodyException.java | 3 +- .../soap/saaj/SaajSoapElementException.java | 3 +- .../soap/saaj/SaajSoapEnvelopeException.java | 3 +- .../ws/soap/saaj/SaajSoapFaultDetail.java | 1 + .../soap/saaj/SaajSoapFaultDetailElement.java | 2 +- .../ws/soap/saaj/SaajSoapFaultException.java | 3 +- .../ws/soap/saaj/SaajSoapHeader.java | 6 +-- .../ws/soap/saaj/SaajSoapHeaderException.java | 3 +- .../SaajSoapMessageCreationException.java | 3 +- .../soap/saaj/SaajSoapMessageException.java | 3 +- .../ws/soap/saaj/support/SaajUtils.java | 9 ++-- ...gValidatingMarshallingPayloadEndpoint.java | 13 +++--- ...tSoapFaultDefinitionExceptionResolver.java | 7 ++- ...actFaultCreatingValidatingInterceptor.java | 12 ++--- .../ws/transport/TransportException.java | 3 +- .../http/AbstractHttpSenderConnection.java | 1 + .../transport/http/HttpServletConnection.java | 5 +- .../http/HttpTransportException.java | 3 +- .../http/MessageDispatcherServlet.java | 5 +- .../ws/wsdl/WsdlDefinitionException.java | 3 +- .../wsdl11/Wsdl4jDefinitionException.java | 3 +- ...WebServiceTemplateIntegrationTestCase.java | 6 +++ ...WebServiceTemplateIntegrationTestCase.java | 9 +++- ...mPoxWebServiceTemplateIntegrationTest.java | 2 + .../ws/client/core/SimpleSaajServlet.java | 3 +- .../client/core/WebServiceTemplateTest.java | 1 + .../PayloadValidatingInterceptorTest.java | 12 ++--- .../ws/mime/AbstractMimeMessageTestCase.java | 11 ++--- .../PayloadTransformingInterceptorTest.java | 17 ++++--- .../ws/soap/axiom/AxiomSoap11BodyTest.java | 12 ++--- .../axiom/AxiomSoap11NonCachingBodyTest.java | 4 +- .../AxiomSoap11NonCachingMessageTest.java | 11 ++--- .../ws/soap/axiom/AxiomSoap12BodyTest.java | 12 ++--- .../axiom/AxiomSoap12NonCachingBodyTest.java | 4 +- ...pFaultAnnotationExceptionResolverTest.java | 18 ++++++-- .../PayloadValidatingInterceptorTest.java | 23 +++++----- .../soap11/AbstractSoap11HeaderTestCase.java | 19 ++++---- .../soap11/AbstractSoap11MessageTestCase.java | 23 +++++----- .../soap12/AbstractSoap12HeaderTestCase.java | 21 ++++----- ...rviceMessageSenderIntegrationTestCase.java | 26 +++++------ ...mmonsHttpMessageSenderIntegrationTest.java | 20 ++++---- ...omponentsMessageSenderIntegrationTest.java | 17 +++---- .../ws/soap/security/WsSecurityException.java | 3 +- .../security/WsSecurityFaultException.java | 3 +- .../WsSecuritySecurementException.java | 3 +- .../WsSecurityValidationException.java | 3 +- .../security/support/SpringSecurityUtils.java | 12 +++-- .../wss4j/Wss4jSecurityFaultException.java | 3 +- .../Wss4jSecuritySecurementException.java | 3 +- .../Wss4jSecurityValidationException.java | 3 +- .../x509/X509AuthenticationProvider.java | 2 +- .../x509/cache/EhCacheBasedX509UserCache.java | 2 +- .../xwss/XwsSecurityFaultException.java | 17 +++++++ .../xwss/XwsSecuritySecurementException.java | 3 +- .../xwss/XwsSecurityValidationException.java | 3 +- ...jMessageInterceptorEncryptionTestCase.java | 13 +++--- .../Wss4jMessageInterceptorX509TestCase.java | 15 +++--- .../callback/jaas/PlainTextLoginModule.java | 3 +- .../http/HttpExchangeConnection.java | 1 + .../http/HttpsTransportException.java | 3 +- .../transport/jms/JmsTransportException.java | 3 +- .../mail/MailTransportException.java | 3 +- .../ws/test/support/SourceAssertionError.java | 5 +- .../org/springframework/xml/XmlException.java | 3 +- .../xml/namespace/QNameEditor.java | 4 +- .../xml/namespace/QNameUtils.java | 46 +++++++------------ .../validation/XmlValidationException.java | 3 +- .../xml/xpath/XPathException.java | 3 +- .../xml/xpath/XPathParseException.java | 3 +- .../xml/xsd/SimpleXsdSchema.java | 5 +- .../xml/xsd/XsdSchemaException.java | 3 +- .../commons/CommonsXsdSchemaException.java | 3 +- .../namespace/SimpleNamespaceContextTest.java | 14 +++--- 125 files changed, 444 insertions(+), 354 deletions(-) diff --git a/build.gradle b/build.gradle index f36ad8d3..2acaba6c 100644 --- a/build.gradle +++ b/build.gradle @@ -19,27 +19,21 @@ configure(allprojects) { apply plugin: "propdeps-idea" apply plugin: "propdeps" -/* [compileJava, compileTestJava]*.options*.compilerArgs = [ - "-Xlint:serial", - "-Xlint:varargs", - "-Xlint:cast", - "-Xlint:classfile", - "-Xlint:dep-ann", - "-Xlint:divzero", - "-Xlint:empty", - "-Xlint:finally", - "-Xlint:overrides", - "-Xlint:path", - "-Xlint:processing", - "-Xlint:static", - "-Xlint:try", - "-Xlint:-options", // intentionally disabled - "-Xlint:-fallthrough", // intentionally disabled - "-Xlint:-rawtypes", // TODO enable and fix warnings - "-Xlint:-deprecation", // TODO enable and fix warnings - "-Xlint:-unchecked" // TODO enable and fix warnings + compileJava.options*.compilerArgs = [ + "-Xlint:serial", "-Xlint:varargs", "-Xlint:cast", "-Xlint:classfile", + "-Xlint:dep-ann", "-Xlint:divzero", "-Xlint:empty", "-Xlint:finally", + "-Xlint:overrides", "-Xlint:path", "-Xlint:processing", "-Xlint:static", + "-Xlint:try", "-Xlint:fallthrough", "-Xlint:rawtypes", "-Xlint:deprecation", + "-Xlint:unchecked", "-Xlint:-options", "-Werror" ] -*/ + + compileTestJava.options*.compilerArgs = [ + "-Xlint:serial", "-Xlint:varargs", "-Xlint:cast", "-Xlint:classfile", + "-Xlint:dep-ann", "-Xlint:divzero", "-Xlint:empty", "-Xlint:finally", + "-Xlint:overrides", "-Xlint:path", "-Xlint:processing", "-Xlint:static", + "-Xlint:try", "-Xlint:-fallthrough", "-Xlint:-rawtypes", "-Xlint:-deprecation", + "-Xlint:-unchecked", "-Xlint:-options"] + compileJava { sourceCompatibility=1.6 targetCompatibility=1.6 diff --git a/spring-ws-core/src/main/java/org/springframework/ws/InvalidXmlException.java b/spring-ws-core/src/main/java/org/springframework/ws/InvalidXmlException.java index be887dd1..7af8a365 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/InvalidXmlException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/InvalidXmlException.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2012 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -23,6 +23,7 @@ package org.springframework.ws; * @author Arjen Poutsma * @since 2.0.4 */ +@SuppressWarnings("serial") public final class InvalidXmlException extends WebServiceException { public InvalidXmlException(String msg, Throwable ex) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/NoEndpointFoundException.java b/spring-ws-core/src/main/java/org/springframework/ws/NoEndpointFoundException.java index 64f632c4..5b0d3624 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/NoEndpointFoundException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/NoEndpointFoundException.java @@ -1,5 +1,5 @@ /* - * Copyright 2005 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ package org.springframework.ws; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public final class NoEndpointFoundException extends WebServiceException { public NoEndpointFoundException(WebServiceMessage request) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/WebServiceException.java b/spring-ws-core/src/main/java/org/springframework/ws/WebServiceException.java index 80d6d91b..c66a2ac2 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/WebServiceException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/WebServiceException.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import org.springframework.core.NestedRuntimeException; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public abstract class WebServiceException extends NestedRuntimeException { /** diff --git a/spring-ws-core/src/main/java/org/springframework/ws/WebServiceMessageException.java b/spring-ws-core/src/main/java/org/springframework/ws/WebServiceMessageException.java index f0db261f..9e28207c 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/WebServiceMessageException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/WebServiceMessageException.java @@ -1,5 +1,5 @@ /* - * Copyright 2005 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ package org.springframework.ws; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public abstract class WebServiceMessageException extends WebServiceException { /** Constructor for {@code WebServiceMessageException}. */ diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceClientException.java b/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceClientException.java index 74c3e314..19100e6d 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceClientException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceClientException.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import org.springframework.ws.WebServiceException; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public abstract class WebServiceClientException extends WebServiceException { /** diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceFaultException.java b/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceFaultException.java index 8d3240c6..bebd8757 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceFaultException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceFaultException.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import org.springframework.ws.FaultAwareWebServiceMessage; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public class WebServiceFaultException extends WebServiceClientException { private final FaultAwareWebServiceMessage faultMessage; diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceIOException.java b/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceIOException.java index 85dc21db..ca81420a 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceIOException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceIOException.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import java.io.IOException; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public class WebServiceIOException extends WebServiceClientException { /** diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceTransformerException.java b/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceTransformerException.java index 7ccdc460..e69c803a 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceTransformerException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceTransformerException.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import javax.xml.transform.TransformerException; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public class WebServiceTransformerException extends WebServiceClientException { /** diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceTransportException.java b/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceTransportException.java index 563b9311..eee5992e 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceTransportException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceTransportException.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import org.springframework.ws.transport.TransportException; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public class WebServiceTransportException extends WebServiceIOException { /** diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/support/destination/DestinationProvisionException.java b/spring-ws-core/src/main/java/org/springframework/ws/client/support/destination/DestinationProvisionException.java index 1f614ff0..f8474259 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/client/support/destination/DestinationProvisionException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/client/support/destination/DestinationProvisionException.java @@ -1,5 +1,5 @@ /* - * Copyright 2008 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import org.springframework.ws.client.WebServiceClientException; * @author Arjen Poutsma * @since 1.5.4 */ +@SuppressWarnings("serial") public class DestinationProvisionException extends WebServiceClientException { public DestinationProvisionException(String msg) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/support/interceptor/WebServiceValidationException.java b/spring-ws-core/src/main/java/org/springframework/ws/client/support/interceptor/WebServiceValidationException.java index 2447d742..47ef87bb 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/client/support/interceptor/WebServiceValidationException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/client/support/interceptor/WebServiceValidationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,10 +16,10 @@ package org.springframework.ws.client.support.interceptor; -import org.springframework.ws.client.WebServiceClientException; - import org.xml.sax.SAXParseException; +import org.springframework.ws.client.WebServiceClientException; + /** * Exception thrown whenever a validation error occurs on the client-side. * @@ -27,6 +27,7 @@ import org.xml.sax.SAXParseException; * @author Arjen Poutsma * @since 1.5.4 */ +@SuppressWarnings("serial") public class WebServiceValidationException extends WebServiceClientException { private SAXParseException[] validationErrors; diff --git a/spring-ws-core/src/main/java/org/springframework/ws/config/WebServicesNamespaceHandler.java b/spring-ws-core/src/main/java/org/springframework/ws/config/WebServicesNamespaceHandler.java index 5ecbda4d..180f1850 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/config/WebServicesNamespaceHandler.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/config/WebServicesNamespaceHandler.java @@ -28,6 +28,7 @@ import org.springframework.beans.factory.xml.NamespaceHandlerSupport; public class WebServicesNamespaceHandler extends NamespaceHandlerSupport { @Override + @SuppressWarnings("deprecation") public void init() { registerBeanDefinitionParser("annotation-driven", new AnnotationDrivenBeanDefinitionParser()); registerBeanDefinitionParser("interceptors", new InterceptorsBeanDefinitionParser()); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/mime/AttachmentException.java b/spring-ws-core/src/main/java/org/springframework/ws/mime/AttachmentException.java index bb393286..a27c37b0 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/mime/AttachmentException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/mime/AttachmentException.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ import org.springframework.ws.WebServiceMessageException; * @see Attachment * @since 1.0.0 */ +@SuppressWarnings("serial") public class AttachmentException extends WebServiceMessageException { public AttachmentException(String msg) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/pox/PoxMessageException.java b/spring-ws-core/src/main/java/org/springframework/ws/pox/PoxMessageException.java index 291c1a3e..d273353d 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/pox/PoxMessageException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/pox/PoxMessageException.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import org.springframework.ws.WebServiceMessageException; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public abstract class PoxMessageException extends WebServiceMessageException { public PoxMessageException(String msg) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/pox/dom/DomPoxMessageException.java b/spring-ws-core/src/main/java/org/springframework/ws/pox/dom/DomPoxMessageException.java index 7f04afc0..787fcd08 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/pox/dom/DomPoxMessageException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/pox/dom/DomPoxMessageException.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import org.springframework.ws.pox.PoxMessageException; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public class DomPoxMessageException extends PoxMessageException { public DomPoxMessageException(String msg) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractValidatingMarshallingPayloadEndpoint.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractValidatingMarshallingPayloadEndpoint.java index 63493dd5..5370f47a 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractValidatingMarshallingPayloadEndpoint.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractValidatingMarshallingPayloadEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,7 +29,9 @@ import org.springframework.ws.context.MessageContext; * * @author Arjen Poutsma * @since 1.0.2 + * @deprecated as of Spring Web Services 2.0, in favor of annotated endpoints */ +@Deprecated public abstract class AbstractValidatingMarshallingPayloadEndpoint extends AbstractMarshallingPayloadEndpoint { /** Default request object name used for validating request objects. */ diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractXomPayloadEndpoint.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractXomPayloadEndpoint.java index cb16577f..991620d1 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractXomPayloadEndpoint.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractXomPayloadEndpoint.java @@ -208,6 +208,7 @@ public abstract class AbstractXomPayloadEndpoint extends TransformerObjectSuppor } } + @SuppressWarnings("serial") private static class XomParsingException extends NestedRuntimeException { private XomParsingException(ParsingException ex) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/XPathParamMethodArgumentResolver.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/XPathParamMethodArgumentResolver.java index 2278ee81..18231bdc 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/XPathParamMethodArgumentResolver.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/XPathParamMethodArgumentResolver.java @@ -33,6 +33,7 @@ import org.w3c.dom.NodeList; import org.springframework.core.MethodParameter; import org.springframework.core.convert.ConversionService; import org.springframework.core.convert.support.ConversionServiceFactory; +import org.springframework.core.convert.support.DefaultConversionService; import org.springframework.ws.context.MessageContext; import org.springframework.ws.server.endpoint.annotation.XPathParam; import org.springframework.ws.server.endpoint.support.NamespaceUtils; @@ -55,7 +56,7 @@ public class XPathParamMethodArgumentResolver implements MethodArgumentResolver private TransformerHelper transformerHelper = new TransformerHelper(); - private ConversionService conversionService = ConversionServiceFactory.createDefaultConversionService(); + private ConversionService conversionService = new DefaultConversionService(); /** * Sets the conversion service to use. diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/AbstractJaxb2PayloadMethodProcessor.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/AbstractJaxb2PayloadMethodProcessor.java index 2ef5e3da..edb4287d 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/AbstractJaxb2PayloadMethodProcessor.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/AbstractJaxb2PayloadMethodProcessor.java @@ -70,7 +70,7 @@ import org.springframework.xml.transform.TraxUtils; */ public abstract class AbstractJaxb2PayloadMethodProcessor extends AbstractPayloadMethodProcessor { - private final ConcurrentMap jaxbContexts = new ConcurrentHashMap(); + private final ConcurrentMap, JAXBContext> jaxbContexts = new ConcurrentHashMap, JAXBContext>(); @Override public final void handleReturnValue(MessageContext messageContext, diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/SoapBodyException.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/SoapBodyException.java index 258db741..80f8fe29 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/SoapBodyException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/SoapBodyException.java @@ -1,5 +1,5 @@ /* - * Copyright 2005 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ package org.springframework.ws.soap; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public class SoapBodyException extends SoapMessageException { public SoapBodyException(String msg) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/SoapElementException.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/SoapElementException.java index 6abdad0e..c47feb18 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/SoapElementException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/SoapElementException.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ package org.springframework.ws.soap; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public class SoapElementException extends SoapMessageException { public SoapElementException(String msg) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/SoapEnvelopeException.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/SoapEnvelopeException.java index a4fa3ce3..e7e1576b 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/SoapEnvelopeException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/SoapEnvelopeException.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ package org.springframework.ws.soap; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public class SoapEnvelopeException extends SoapMessageException { public SoapEnvelopeException(String msg) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/SoapFaultException.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/SoapFaultException.java index 14c4e139..fe4c7afb 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/SoapFaultException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/SoapFaultException.java @@ -1,5 +1,5 @@ /* - * Copyright 2005 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ package org.springframework.ws.soap; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public class SoapFaultException extends SoapEnvelopeException { public SoapFaultException(String msg) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/SoapHeaderException.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/SoapHeaderException.java index b27a8b9e..f17b8bfb 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/SoapHeaderException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/SoapHeaderException.java @@ -1,5 +1,5 @@ /* - * Copyright 2005 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ package org.springframework.ws.soap; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public class SoapHeaderException extends SoapMessageException { public SoapHeaderException(String msg) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/SoapMessageCreationException.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/SoapMessageCreationException.java index 78dc6b82..3670969c 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/SoapMessageCreationException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/SoapMessageCreationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2005 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ package org.springframework.ws.soap; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public class SoapMessageCreationException extends SoapMessageException { /** Constructor for {@code SoapMessageCreationException}. */ diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/SoapMessageException.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/SoapMessageException.java index 7a51f76e..5ab990a9 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/SoapMessageException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/SoapMessageException.java @@ -1,5 +1,5 @@ /* - * Copyright 2005 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import org.springframework.ws.WebServiceMessageException; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public abstract class SoapMessageException extends WebServiceMessageException { /** Constructor for {@code SoapMessageException}. */ diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/AddressingException.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/AddressingException.java index 686eb4ce..8a5734de 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/AddressingException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/AddressingException.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import org.springframework.ws.WebServiceException; * @author Arjen Poutsma * @since 1.5.0 */ +@SuppressWarnings("serial") public class AddressingException extends WebServiceException { public AddressingException(String msg) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/server/SimpleActionEndpointMapping.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/server/SimpleActionEndpointMapping.java index bade2b75..4470dcd4 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/server/SimpleActionEndpointMapping.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/server/SimpleActionEndpointMapping.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,7 +51,7 @@ import org.springframework.beans.BeansException; public class SimpleActionEndpointMapping extends AbstractActionEndpointMapping { // contents will be copied over to endpointMap - private final Map actionMap = new HashMap(); + private final Map actionMap = new HashMap(); private URI address; diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/version/AbstractAddressingVersion.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/version/AbstractAddressingVersion.java index 55043622..092d491b 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/version/AbstractAddressingVersion.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/version/AbstractAddressingVersion.java @@ -302,7 +302,8 @@ public abstract class AbstractAddressingVersion extends TransformerObjectSupport } else if (message.getSoapBody() instanceof Soap12Body) { Soap12Body soapBody = (Soap12Body) message.getSoapBody(); - Soap12Fault soapFault = (Soap12Fault) soapBody.addClientOrSenderFault(reason, Locale.ENGLISH); + Soap12Fault soapFault = + soapBody.addClientOrSenderFault(reason, Locale.ENGLISH); soapFault.addFaultSubcode(subcode); return soapFault; } @@ -339,37 +340,37 @@ public abstract class AbstractAddressingVersion extends TransformerObjectSupport /** Returns the qualified name of the {@code To} addressing header. */ protected QName getToName() { - return QNameUtils.createQName(getNamespaceUri(), "To", getNamespacePrefix()); + return new QName(getNamespaceUri(), "To", getNamespacePrefix()); } /** Returns the qualified name of the {@code From} addressing header. */ protected QName getFromName() { - return QNameUtils.createQName(getNamespaceUri(), "From", getNamespacePrefix()); + return new QName(getNamespaceUri(), "From", getNamespacePrefix()); } /** Returns the qualified name of the {@code ReplyTo} addressing header. */ protected QName getReplyToName() { - return QNameUtils.createQName(getNamespaceUri(), "ReplyTo", getNamespacePrefix()); + return new QName(getNamespaceUri(), "ReplyTo", getNamespacePrefix()); } /** Returns the qualified name of the {@code FaultTo} addressing header. */ protected QName getFaultToName() { - return QNameUtils.createQName(getNamespaceUri(), "FaultTo", getNamespacePrefix()); + return new QName(getNamespaceUri(), "FaultTo", getNamespacePrefix()); } /** Returns the qualified name of the {@code Action} addressing header. */ protected QName getActionName() { - return QNameUtils.createQName(getNamespaceUri(), "Action", getNamespacePrefix()); + return new QName(getNamespaceUri(), "Action", getNamespacePrefix()); } /** Returns the qualified name of the {@code MessageID} addressing header. */ protected QName getMessageIdName() { - return QNameUtils.createQName(getNamespaceUri(), "MessageID", getNamespacePrefix()); + return new QName(getNamespaceUri(), "MessageID", getNamespacePrefix()); } /** Returns the qualified name of the {@code RelatesTo} addressing header. */ protected QName getRelatesToName() { - return QNameUtils.createQName(getNamespaceUri(), "RelatesTo", getNamespacePrefix()); + return new QName(getNamespaceUri(), "RelatesTo", getNamespacePrefix()); } /** Returns the qualified name of the {@code RelatesTo} addressing header. */ @@ -382,7 +383,7 @@ public abstract class AbstractAddressingVersion extends TransformerObjectSupport * {@code null} when reference properties are not supported by this version of the spec. */ protected QName getReferencePropertiesName() { - return QNameUtils.createQName(getNamespaceUri(), "ReferenceProperties", getNamespacePrefix()); + return new QName(getNamespaceUri(), "ReferenceProperties", getNamespacePrefix()); } /** @@ -390,7 +391,7 @@ public abstract class AbstractAddressingVersion extends TransformerObjectSupport * {@code null} when reference parameters are not supported by this version of the spec. */ protected QName getReferenceParametersName() { - return QNameUtils.createQName(getNamespaceUri(), "ReferenceParameters", getNamespacePrefix()); + return new QName(getNamespaceUri(), "ReferenceParameters", getNamespacePrefix()); } /* @@ -399,7 +400,7 @@ public abstract class AbstractAddressingVersion extends TransformerObjectSupport /** The qualified name of the {@code Address} in {@code EndpointReference}. */ protected QName getAddressName() { - return QNameUtils.createQName(getNamespaceUri(), "Address", getNamespacePrefix()); + return new QName(getNamespaceUri(), "Address", getNamespacePrefix()); } /** Returns the default To URI. */ diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/version/Addressing10.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/version/Addressing10.java index 18921ec2..649578c0 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/version/Addressing10.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/version/Addressing10.java @@ -23,7 +23,6 @@ import org.springframework.util.Assert; import org.springframework.ws.soap.SoapMessage; import org.springframework.ws.soap.addressing.core.EndpointReference; import org.springframework.ws.soap.addressing.core.MessageAddressingProperties; -import org.springframework.xml.namespace.QNameUtils; /** * Implements WS-Addressing 1.0 (May 2006). This version of the specification is used by Microsoft's Windows @@ -88,7 +87,8 @@ public class Addressing10 extends AbstractAddressingVersion { @Override protected final QName getMessageAddressingHeaderRequiredFaultSubcode() { - return QNameUtils.createQName(NAMESPACE_URI, "MessageAddressingHeaderRequired", getNamespacePrefix()); + return new QName(NAMESPACE_URI, "MessageAddressingHeaderRequired", + getNamespacePrefix()); } @Override @@ -98,7 +98,7 @@ public class Addressing10 extends AbstractAddressingVersion { @Override protected QName getInvalidAddressingHeaderFaultSubcode() { - return QNameUtils.createQName(NAMESPACE_URI, "InvalidAddressingHeader", getNamespacePrefix()); + return new QName(NAMESPACE_URI, "InvalidAddressingHeader", getNamespacePrefix()); } @Override diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/version/Addressing200408.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/version/Addressing200408.java index e7e57393..3712149a 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/version/Addressing200408.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/version/Addressing200408.java @@ -23,7 +23,6 @@ import org.springframework.util.Assert; import org.springframework.ws.soap.SoapMessage; import org.springframework.ws.soap.addressing.core.EndpointReference; import org.springframework.ws.soap.addressing.core.MessageAddressingProperties; -import org.springframework.xml.namespace.QNameUtils; /** * Implements the August 2004 edition of the WS-Addressing specification. This version of the specification is used by @@ -71,7 +70,8 @@ public class Addressing200408 extends AbstractAddressingVersion { @Override protected final QName getInvalidAddressingHeaderFaultSubcode() { - return QNameUtils.createQName(NAMESPACE_URI, "InvalidMessageInformationHeader", getNamespacePrefix()); + return new QName(NAMESPACE_URI, "InvalidMessageInformationHeader", + getNamespacePrefix()); } @Override @@ -81,7 +81,8 @@ public class Addressing200408 extends AbstractAddressingVersion { @Override protected final QName getMessageAddressingHeaderRequiredFaultSubcode() { - return QNameUtils.createQName(NAMESPACE_URI, "MessageInformationHeaderRequired", getNamespacePrefix()); + return new QName(NAMESPACE_URI, "MessageInformationHeaderRequired", + getNamespacePrefix()); } @Override diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomAttachmentException.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomAttachmentException.java index 5eea0ae7..d480c9ac 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomAttachmentException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomAttachmentException.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ package org.springframework.ws.soap.axiom; import org.springframework.ws.mime.AttachmentException; /** @author Arjen Poutsma */ +@SuppressWarnings("serial") public class AxiomAttachmentException extends AttachmentException { public AxiomAttachmentException(String msg) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap11Body.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap11Body.java index 07cc5b3a..7848264f 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap11Body.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap11Body.java @@ -34,7 +34,6 @@ import org.springframework.util.StringUtils; import org.springframework.ws.soap.axiom.support.AxiomUtils; import org.springframework.ws.soap.soap11.Soap11Body; import org.springframework.ws.soap.soap11.Soap11Fault; -import org.springframework.xml.namespace.QNameUtils; /** * Axiom-specific version of {@code org.springframework.ws.soap.Soap11Body}. @@ -108,7 +107,7 @@ class AxiomSoap11Body extends AxiomSoapBody implements Soap11Body { } private void setValueText(QName code, SOAPFault fault, SOAPFaultCode faultCode) { - String prefix = QNameUtils.getPrefix(code); + String prefix = code.getPrefix(); if (StringUtils.hasLength(code.getNamespaceURI()) && StringUtils.hasLength(prefix)) { OMNamespace namespace = fault.findNamespaceURI(prefix); if (namespace == null) { @@ -120,7 +119,8 @@ class AxiomSoap11Body extends AxiomSoapBody implements Soap11Body { if (namespace == null) { namespace = fault.declareNamespace(code.getNamespaceURI(), ""); } - code = QNameUtils.createQName(code.getNamespaceURI(), code.getLocalPart(), namespace.getPrefix()); + code = new QName(code.getNamespaceURI(), code.getLocalPart(), + namespace.getPrefix()); } faultCode.setText(code); } @@ -131,8 +131,8 @@ class AxiomSoap11Body extends AxiomSoapBody implements Soap11Body { AxiomUtils.removeContents(getAxiomBody()); SOAPFault fault = getAxiomFactory().createSOAPFault(getAxiomBody()); SOAPFaultCode faultCode = getAxiomFactory().createSOAPFaultCode(fault); - faultCode.setText(QNameUtils.createQName(fault.getNamespace().getNamespaceURI(), localName, - fault.getNamespace().getPrefix())); + faultCode.setText(new QName(fault.getNamespace().getNamespaceURI(), localName, + fault.getNamespace().getPrefix())); SOAPFaultReason faultReason = getAxiomFactory().createSOAPFaultReason(fault); if (locale != null) { addLangAttribute(locale, faultReason); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap12Fault.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap12Fault.java index 2145c9b3..8315c3a1 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap12Fault.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap12Fault.java @@ -36,7 +36,6 @@ import org.apache.axiom.soap.SOAPProcessingException; import org.springframework.util.StringUtils; import org.springframework.ws.soap.axiom.support.AxiomUtils; import org.springframework.ws.soap.soap12.Soap12Fault; -import org.springframework.xml.namespace.QNameUtils; /** Axiom-specific version of {@code org.springframework.ws.soap.Soap12Fault}. */ class AxiomSoap12Fault extends AxiomSoapFault implements Soap12Fault { @@ -85,7 +84,7 @@ class AxiomSoap12Fault extends AxiomSoapFault implements Soap12Fault { } private void setValueText(QName code, SOAPFaultValue faultValue) { - String prefix = QNameUtils.getPrefix(code); + String prefix = code.getPrefix(); if (StringUtils.hasLength(code.getNamespaceURI()) && StringUtils.hasLength(prefix)) { OMNamespace namespace = getAxiomFault().findNamespaceURI(prefix); if (namespace == null) { @@ -97,7 +96,8 @@ class AxiomSoap12Fault extends AxiomSoapFault implements Soap12Fault { if (namespace == null) { throw new IllegalArgumentException("Could not resolve namespace of code [" + code + "]"); } - code = QNameUtils.createQName(code.getNamespaceURI(), code.getLocalPart(), namespace.getPrefix()); + code = new QName(code.getNamespaceURI(), code.getLocalPart(), + namespace.getPrefix()); } faultValue.setText(prefix + ":" + code.getLocalPart()); } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap12Header.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap12Header.java index 0829e00c..792367ed 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap12Header.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap12Header.java @@ -34,7 +34,6 @@ import org.springframework.util.ObjectUtils; import org.springframework.ws.soap.SoapHeaderElement; import org.springframework.ws.soap.SoapHeaderException; import org.springframework.ws.soap.soap12.Soap12Header; -import org.springframework.xml.namespace.QNameUtils; /** * Axiom-specific version of {@code org.springframework.ws.soap.Soap12Header}. @@ -53,8 +52,9 @@ class AxiomSoap12Header extends AxiomSoapHeader implements Soap12Header { try { SOAPHeaderBlock notUnderstood = getAxiomHeader().addHeaderBlock("NotUnderstood", getAxiomHeader().getNamespace()); - OMNamespace headerNamespace = - notUnderstood.declareNamespace(headerName.getNamespaceURI(), QNameUtils.getPrefix(headerName)); + OMNamespace headerNamespace = + notUnderstood.declareNamespace(headerName.getNamespaceURI(), + headerName.getPrefix()); notUnderstood.addAttribute("qname", headerNamespace.getPrefix() + ":" + headerName.getLocalPart(), null); return new AxiomSoapHeaderElement(notUnderstood, getAxiomFactory()); } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapBodyException.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapBodyException.java index c9ba8354..76d20f0f 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapBodyException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapBodyException.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ import org.springframework.ws.soap.SoapEnvelopeException; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public class AxiomSoapBodyException extends SoapEnvelopeException { public AxiomSoapBodyException(String msg) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapElementException.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapElementException.java index 1e7a1c4b..c280d85c 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapElementException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapElementException.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ package org.springframework.ws.soap.axiom; import org.springframework.ws.soap.SoapElementException; +@SuppressWarnings("serial") public class AxiomSoapElementException extends SoapElementException { public AxiomSoapElementException(String msg) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapEnvelopeException.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapEnvelopeException.java index 0c606a95..cebe9450 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapEnvelopeException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapEnvelopeException.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ import org.springframework.ws.soap.SoapEnvelopeException; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public class AxiomSoapEnvelopeException extends SoapEnvelopeException { public AxiomSoapEnvelopeException(String msg) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapFaultDetail.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapFaultDetail.java index 60ab30d0..f012c224 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapFaultDetail.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapFaultDetail.java @@ -53,6 +53,7 @@ class AxiomSoapFaultDetail extends AxiomSoapElement implements SoapFaultDetail { } @Override + @SuppressWarnings("unchecked") public Iterator getDetailEntries() { return new AxiomSoapFaultDetailElementIterator(getAxiomFaultDetail().getChildElements()); } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapFaultException.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapFaultException.java index 0ca42c1d..bf420524 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapFaultException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapFaultException.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ import org.springframework.ws.soap.SoapFaultException; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public class AxiomSoapFaultException extends SoapFaultException { public AxiomSoapFaultException(String msg) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapHeader.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapHeader.java index 7b8cf89a..3bb805eb 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapHeader.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapHeader.java @@ -30,7 +30,6 @@ import org.apache.axiom.soap.SOAPHeaderBlock; import org.springframework.ws.soap.SoapHeader; import org.springframework.ws.soap.SoapHeaderElement; import org.springframework.ws.soap.SoapHeaderException; -import org.springframework.xml.namespace.QNameUtils; /** * Axiom-specific version of {@code org.springframework.ws.soap.SoapHeader}. @@ -52,8 +51,9 @@ abstract class AxiomSoapHeader extends AxiomSoapElement implements SoapHeader { @Override public SoapHeaderElement addHeaderElement(QName name) { try { - OMNamespace namespace = - getAxiomFactory().createOMNamespace(name.getNamespaceURI(), QNameUtils.getPrefix(name)); + OMNamespace namespace = + getAxiomFactory().createOMNamespace(name.getNamespaceURI(), + name.getPrefix()); SOAPHeaderBlock axiomHeaderBlock = getAxiomHeader().addHeaderBlock(name.getLocalPart(), namespace); return new AxiomSoapHeaderElement(axiomHeaderBlock, getAxiomFactory()); } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapHeaderException.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapHeaderException.java index cfed752e..9b5debc1 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapHeaderException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapHeaderException.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ import org.springframework.ws.soap.SoapHeaderException; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public class AxiomSoapHeaderException extends SoapHeaderException { public AxiomSoapHeaderException(String msg) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapMessageCreationException.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapMessageCreationException.java index 4bdc4ed8..bf6ad5b1 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapMessageCreationException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapMessageCreationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ import org.springframework.ws.soap.SoapMessageCreationException; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public class AxiomSoapMessageCreationException extends SoapMessageCreationException { public AxiomSoapMessageCreationException(String msg) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapMessageException.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapMessageException.java index 6d244d02..6db0a3ad 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapMessageException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapMessageException.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ import org.springframework.ws.soap.SoapMessageException; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public class AxiomSoapMessageException extends SoapMessageException { public AxiomSoapMessageException(String msg) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapMessageFactory.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapMessageFactory.java index 1d8ce29e..a8477a98 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapMessageFactory.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapMessageFactory.java @@ -44,11 +44,11 @@ import org.springframework.beans.factory.InitializingBean; import org.springframework.util.Assert; import org.springframework.util.StringUtils; import org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor; -import org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping; +import org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping; import org.springframework.ws.soap.SoapMessageFactory; import org.springframework.ws.soap.SoapVersion; import org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor; -import org.springframework.ws.soap.server.endpoint.mapping.SoapActionEndpointMapping; +import org.springframework.ws.soap.server.endpoint.mapping.SoapActionAnnotationMethodEndpointMapping; import org.springframework.ws.soap.support.SoapUtils; import org.springframework.ws.transport.TransportConstants; import org.springframework.ws.transport.TransportInputStream; @@ -61,9 +61,9 @@ import org.springframework.ws.transport.TransportInputStream; * #setPayloadCaching(boolean) payloadCaching} property to {@code false} (default is {@code true}). This this * will read the contents of the body directly from the stream. However, when this setting is enabled, the * payload can only be read once. This means that any endpoint mappings or interceptors which are based on the - * message payload (such as the {@link PayloadRootQNameEndpointMapping}, the {@link PayloadValidatingInterceptor}, or + * message payload (such as the {@link PayloadRootAnnotationMethodEndpointMapping}, the {@link PayloadValidatingInterceptor}, or * the {@link PayloadLoggingInterceptor}) cannot be used. Instead, use an endpoint mapping that does not consume the - * payload (i.e. the {@link SoapActionEndpointMapping}). + * payload (i.e. the {@link SoapActionAnnotationMethodEndpointMapping}). * *

Additionally, this message factory can cache large attachments to disk by setting the {@link * #setAttachmentCaching(boolean) attachmentCaching} property to {@code true} (default is {@code false}). diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/support/AxiomUtils.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/support/AxiomUtils.java index d8f3416e..87408ace 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/support/AxiomUtils.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/support/AxiomUtils.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2012 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -26,10 +26,6 @@ import javax.xml.namespace.QName; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.stream.XMLInputFactory; -import org.springframework.util.Assert; -import org.springframework.util.StringUtils; -import org.springframework.xml.namespace.QNameUtils; - import org.apache.axiom.om.OMContainer; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.OMException; @@ -44,6 +40,9 @@ import org.w3c.dom.ls.DOMImplementationLS; import org.w3c.dom.ls.LSOutput; import org.w3c.dom.ls.LSSerializer; +import org.springframework.util.Assert; +import org.springframework.util.StringUtils; + /** * Collection of generic utility methods to work with Axiom. Includes conversion from {@code OMNamespace}s to * {@code QName}s. @@ -68,7 +67,7 @@ public abstract class AxiomUtils { * @throws IllegalArgumentException if {@code qName} is not fully qualified */ public static OMNamespace toNamespace(QName qName, OMElement resolveElement) throws OMException { - String prefix = QNameUtils.getPrefix(qName); + String prefix = qName.getPrefix(); if (StringUtils.hasLength(qName.getNamespaceURI()) && StringUtils.hasLength(prefix)) { return resolveElement.declareNamespace(qName.getNamespaceURI(), prefix); } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/client/SoapFaultClientException.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/client/SoapFaultClientException.java index 953cd4c3..82cd2500 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/client/SoapFaultClientException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/client/SoapFaultClientException.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import org.springframework.ws.soap.SoapMessage; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public class SoapFaultClientException extends WebServiceFaultException { private final SoapFault soapFault; diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajAttachmentException.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajAttachmentException.java index c4b89bd3..b5a0d335 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajAttachmentException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajAttachmentException.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ package org.springframework.ws.soap.saaj; import org.springframework.ws.mime.AttachmentException; /** @author Arjen Poutsma */ +@SuppressWarnings("serial") public class SaajAttachmentException extends AttachmentException { public SaajAttachmentException(String msg) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap11Header.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap11Header.java index e4973c14..c39b6f01 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap11Header.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap11Header.java @@ -41,6 +41,7 @@ class SaajSoap11Header extends SaajSoapHeader implements Soap11Header { } @Override + @SuppressWarnings("unchecked") public Iterator examineHeaderElementsToProcess(String[] actors) { List result = new ArrayList(); Iterator iterator = getSaajHeader().examineAllHeaderElements(); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap12Fault.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap12Fault.java index e609de23..8fa14e43 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap12Fault.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap12Fault.java @@ -50,6 +50,7 @@ class SaajSoap12Fault extends SaajSoapFault implements Soap12Fault { } @Override + @SuppressWarnings("unchecked") public Iterator getFaultSubcodes() { return getSaajFault().getFaultSubcodes(); } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap12Header.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap12Header.java index 3b3c04ea..428dad55 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap12Header.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap12Header.java @@ -68,6 +68,7 @@ class SaajSoap12Header extends SaajSoapHeader implements Soap12Header { } @Override + @SuppressWarnings("unchecked") public Iterator examineHeaderElementsToProcess(String[] roles, boolean isUltimateDestination) throws SoapHeaderException { List result = new ArrayList(); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapBodyException.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapBodyException.java index 3b80d08e..c3d875ad 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapBodyException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapBodyException.java @@ -1,5 +1,5 @@ /* - * Copyright 2005 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ package org.springframework.ws.soap.saaj; import org.springframework.ws.soap.SoapBodyException; /** @author Arjen Poutsma */ +@SuppressWarnings("serial") public class SaajSoapBodyException extends SoapBodyException { public SaajSoapBodyException(String msg) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapElementException.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapElementException.java index b583c96e..9454d805 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapElementException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapElementException.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ package org.springframework.ws.soap.saaj; import org.springframework.ws.soap.SoapElementException; /** @author Arjen Poutsma */ +@SuppressWarnings("serial") public class SaajSoapElementException extends SoapElementException { public SaajSoapElementException(String msg) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapEnvelopeException.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapEnvelopeException.java index 33df627e..55b1b151 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapEnvelopeException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapEnvelopeException.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ import org.springframework.ws.soap.SoapEnvelopeException; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public class SaajSoapEnvelopeException extends SoapEnvelopeException { public SaajSoapEnvelopeException(String msg) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapFaultDetail.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapFaultDetail.java index 1d3cf7cb..3ba3af14 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapFaultDetail.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapFaultDetail.java @@ -59,6 +59,7 @@ class SaajSoapFaultDetail extends SaajSoapElement implements S } @Override + @SuppressWarnings("unchecked") public Iterator getDetailEntries() { Iterator iterator = getSaajDetail().getDetailEntries(); return new SaajSoapFaultDetailElementIterator(iterator); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapFaultDetailElement.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapFaultDetailElement.java index db3320ed..2a10cc2c 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapFaultDetailElement.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapFaultDetailElement.java @@ -52,7 +52,7 @@ class SaajSoapFaultDetailElement extends SaajSoapElement implements } protected DetailEntry getSaajDetailEntry() { - return (DetailEntry) getSaajElement(); + return getSaajElement(); } } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapFaultException.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapFaultException.java index f4b79860..ef512a42 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapFaultException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapFaultException.java @@ -1,5 +1,5 @@ /* - * Copyright 2005 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ import org.springframework.ws.soap.SoapFaultException; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public class SaajSoapFaultException extends SoapFaultException { public SaajSoapFaultException(String msg) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapHeader.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapHeader.java index 8b64bb2b..48e510ec 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapHeader.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapHeader.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2011 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -52,7 +52,7 @@ abstract class SaajSoapHeader extends SaajSoapElement implements Soa @Override @SuppressWarnings("unchecked") public Iterator examineHeaderElements(QName name) throws SoapHeaderException { - Iterator iterator = getSaajHeader().getChildElements(name); + Iterator iterator = getSaajHeader().getChildElements(name); return new SaajSoapHeaderElementIterator(iterator); } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapHeaderException.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapHeaderException.java index e0f632d6..612bd82c 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapHeaderException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapHeaderException.java @@ -1,5 +1,5 @@ /* - * Copyright 2005 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ import org.springframework.ws.soap.SoapHeaderException; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public class SaajSoapHeaderException extends SoapHeaderException { public SaajSoapHeaderException(String msg) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapMessageCreationException.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapMessageCreationException.java index e9718b74..dde1078b 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapMessageCreationException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapMessageCreationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2005 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ import org.springframework.ws.soap.SoapMessageCreationException; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public class SaajSoapMessageCreationException extends SoapMessageCreationException { public SaajSoapMessageCreationException(String msg) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapMessageException.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapMessageException.java index 4efd97f0..8d4aee48 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapMessageException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapMessageException.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ import org.springframework.ws.soap.SoapMessageException; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public class SaajSoapMessageException extends SoapMessageException { public SaajSoapMessageException(String msg) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/support/SaajUtils.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/support/SaajUtils.java index 5d3627c5..32ee17e3 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/support/SaajUtils.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/support/SaajUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,6 @@ import org.springframework.core.io.Resource; import org.springframework.util.Assert; import org.springframework.util.StringUtils; import org.springframework.ws.transport.TransportConstants; -import org.springframework.xml.namespace.QNameUtils; /** * Collection of generic utility methods to work with SAAJ. Includes conversion from SAAJ {@link Name} objects to {@link @@ -128,7 +127,7 @@ public abstract class SaajUtils { * @throws IllegalArgumentException if {@code qName} is not fully qualified */ public static Name toName(QName qName, SOAPElement resolveElement) throws SOAPException { - String qNamePrefix = QNameUtils.getPrefix(qName); + String qNamePrefix = qName.getPrefix(); SOAPEnvelope envelope = getEnvelope(resolveElement); if (StringUtils.hasLength(qName.getNamespaceURI()) && StringUtils.hasLength(qNamePrefix)) { return envelope.createName(qName.getLocalPart(), qNamePrefix, qName.getNamespaceURI()); @@ -162,7 +161,7 @@ public abstract class SaajUtils { */ public static QName toQName(Name name) { if (StringUtils.hasLength(name.getURI()) && StringUtils.hasLength(name.getPrefix())) { - return QNameUtils.createQName(name.getURI(), name.getLocalName(), name.getPrefix()); + return new QName(name.getURI(), name.getLocalName(), name.getPrefix()); } else if (StringUtils.hasLength(name.getURI())) { return new QName(name.getURI(), name.getLocalName()); @@ -217,7 +216,7 @@ public abstract class SaajUtils { * Returns the first child element of the given body. */ public static SOAPElement getFirstBodyElement(SOAPBody body) { - for (Iterator iterator = body.getChildElements(); iterator.hasNext(); ) { + for (Iterator iterator = body.getChildElements(); iterator.hasNext(); ) { Object child = iterator.next(); if (child instanceof SOAPElement) { return (SOAPElement) child; diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/AbstractFaultCreatingValidatingMarshallingPayloadEndpoint.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/AbstractFaultCreatingValidatingMarshallingPayloadEndpoint.java index 84c7e1c4..522059e2 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/AbstractFaultCreatingValidatingMarshallingPayloadEndpoint.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/AbstractFaultCreatingValidatingMarshallingPayloadEndpoint.java @@ -25,16 +25,14 @@ import org.springframework.validation.Errors; import org.springframework.validation.ObjectError; import org.springframework.validation.Validator; import org.springframework.ws.context.MessageContext; -import org.springframework.ws.server.endpoint.AbstractValidatingMarshallingPayloadEndpoint; import org.springframework.ws.soap.SoapBody; import org.springframework.ws.soap.SoapFault; import org.springframework.ws.soap.SoapFaultDetail; import org.springframework.ws.soap.SoapFaultDetailElement; import org.springframework.ws.soap.SoapMessage; -import org.springframework.xml.namespace.QNameUtils; /** - * Extension of the {@link AbstractValidatingMarshallingPayloadEndpoint} which validates the request payload with {@link + * Extension of the {@link org.springframework.ws.server.endpoint.AbstractValidatingMarshallingPayloadEndpoint} which validates the request payload with {@link * Validator}(s), and creates a SOAP Fault whenever the request message cannot be validated. The desired validators can * be set using properties, and must {@link Validator#supports(Class) support} the request object. * @@ -44,9 +42,11 @@ import org.springframework.xml.namespace.QNameUtils; * * @author Arjen Poutsma * @since 1.0.2 + * @deprecated as of Spring Web Services 2.0, in favor of annotated endpoints */ +@Deprecated public abstract class AbstractFaultCreatingValidatingMarshallingPayloadEndpoint - extends AbstractValidatingMarshallingPayloadEndpoint implements MessageSourceAware { + extends org.springframework.ws.server.endpoint.AbstractValidatingMarshallingPayloadEndpoint implements MessageSourceAware { /** * Default SOAP Fault Detail name used when a global validation error occur on the request. @@ -54,9 +54,10 @@ public abstract class AbstractFaultCreatingValidatingMarshallingPayloadEndpoint * @see #setDetailElementName(javax.xml.namespace.QName) */ public static final QName DEFAULT_DETAIL_ELEMENT_NAME = - QNameUtils.createQName("http://springframework.org/spring-ws", "ValidationError", "spring-ws"); + new QName("http://springframework.org/spring-ws", "ValidationError", + "spring-ws"); - /** + /** * Default SOAP Fault string used when a validation errors occur on the request. * * @see #setFaultStringOrReason(String) diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/AbstractSoapFaultDefinitionExceptionResolver.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/AbstractSoapFaultDefinitionExceptionResolver.java index 4a6d061e..5fd4ba3c 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/AbstractSoapFaultDefinitionExceptionResolver.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/AbstractSoapFaultDefinitionExceptionResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -91,9 +91,8 @@ public abstract class AbstractSoapFaultDefinitionExceptionResolver extends Abstr } else if (soapBody instanceof Soap12Body) { Soap12Body soap12Body = (Soap12Body) soapBody; - Soap12Fault soap12Fault = - (Soap12Fault) soap12Body.addServerOrReceiverFault(faultStringOrReason, definition - .getLocale()); + Soap12Fault soap12Fault = soap12Body.addServerOrReceiverFault(faultStringOrReason, definition + .getLocale()); soap12Fault.addFaultSubcode(definition.getFaultCode()); fault = soap12Fault; } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/AbstractFaultCreatingValidatingInterceptor.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/AbstractFaultCreatingValidatingInterceptor.java index dc817061..8862add7 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/AbstractFaultCreatingValidatingInterceptor.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/AbstractFaultCreatingValidatingInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,8 @@ import java.util.Locale; import javax.xml.namespace.QName; import javax.xml.transform.TransformerException; +import org.xml.sax.SAXParseException; + import org.springframework.ws.context.MessageContext; import org.springframework.ws.server.endpoint.interceptor.AbstractValidatingInterceptor; import org.springframework.ws.soap.SoapBody; @@ -27,9 +29,6 @@ import org.springframework.ws.soap.SoapFault; import org.springframework.ws.soap.SoapFaultDetail; import org.springframework.ws.soap.SoapFaultDetailElement; import org.springframework.ws.soap.SoapMessage; -import org.springframework.xml.namespace.QNameUtils; - -import org.xml.sax.SAXParseException; /** * Subclass of {@code AbstractValidatingInterceptor} that creates a SOAP Fault whenever the request message cannot @@ -54,9 +53,10 @@ public abstract class AbstractFaultCreatingValidatingInterceptor extends Abstrac * @see #setDetailElementName(javax.xml.namespace.QName) */ public static final QName DEFAULT_DETAIL_ELEMENT_NAME = - QNameUtils.createQName("http://springframework.org/spring-ws", "ValidationError", "spring-ws"); + new QName("http://springframework.org/spring-ws", "ValidationError", + "spring-ws"); - /** + /** * Default SOAP Fault string used when a validation errors occur on the request. * * @see #setFaultStringOrReason(String) diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/TransportException.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/TransportException.java index 056d473a..f280806c 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/transport/TransportException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/TransportException.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import java.io.IOException; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public abstract class TransportException extends IOException { protected TransportException(String msg) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/AbstractHttpSenderConnection.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/AbstractHttpSenderConnection.java index 83ebb19c..4ea3e234 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/AbstractHttpSenderConnection.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/AbstractHttpSenderConnection.java @@ -153,6 +153,7 @@ public abstract class AbstractHttpSenderConnection extends AbstractSenderConnect } @Override + @Deprecated public final void setFault(boolean fault) { } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpServletConnection.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpServletConnection.java index d735133a..df7edc96 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpServletConnection.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpServletConnection.java @@ -106,13 +106,13 @@ public class HttpServletConnection extends AbstractReceiverConnection @Override @SuppressWarnings("unchecked") protected Iterator getRequestHeaderNames() throws IOException { - return new EnumerationIterator(getHttpServletRequest().getHeaderNames()); + return new EnumerationIterator(getHttpServletRequest().getHeaderNames()); } @Override @SuppressWarnings("unchecked") protected Iterator getRequestHeaders(String name) throws IOException { - return new EnumerationIterator(getHttpServletRequest().getHeaders(name)); + return new EnumerationIterator(getHttpServletRequest().getHeaders(name)); } @Override @@ -156,6 +156,7 @@ public class HttpServletConnection extends AbstractReceiverConnection } @Override + @Deprecated public void setFault(boolean fault) throws IOException { if (fault) { getHttpServletResponse().setStatus(HttpTransportConstants.STATUS_INTERNAL_SERVER_ERROR); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpTransportException.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpTransportException.java index 767e62f1..daf647a9 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpTransportException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpTransportException.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import org.springframework.ws.transport.TransportException; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public class HttpTransportException extends TransportException { public HttpTransportException(String msg) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/MessageDispatcherServlet.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/MessageDispatcherServlet.java index c65501e3..76596a78 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/MessageDispatcherServlet.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/MessageDispatcherServlet.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2012 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -62,6 +62,7 @@ import org.springframework.xml.xsd.XsdSchema; * @see org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter * @since 1.0.0 */ +@SuppressWarnings("serial") public class MessageDispatcherServlet extends FrameworkServlet { /** Well-known name for the {@link WebServiceMessageFactory} bean in the bean factory for this namespace. */ diff --git a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/WsdlDefinitionException.java b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/WsdlDefinitionException.java index fcf50be1..3584fefa 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/WsdlDefinitionException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/WsdlDefinitionException.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import org.springframework.ws.WebServiceException; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public class WsdlDefinitionException extends WebServiceException { public WsdlDefinitionException(String reason) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/Wsdl4jDefinitionException.java b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/Wsdl4jDefinitionException.java index 01a38c1c..b0be6612 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/Wsdl4jDefinitionException.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/Wsdl4jDefinitionException.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,6 +26,7 @@ import org.springframework.ws.wsdl.WsdlDefinitionException; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public class Wsdl4jDefinitionException extends WsdlDefinitionException { public Wsdl4jDefinitionException(WSDLException ex) { diff --git a/spring-ws-core/src/test/java/org/springframework/ws/client/core/AbstractSoap11WebServiceTemplateIntegrationTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/client/core/AbstractSoap11WebServiceTemplateIntegrationTestCase.java index 0e97531b..7b57608b 100644 --- a/spring-ws-core/src/test/java/org/springframework/ws/client/core/AbstractSoap11WebServiceTemplateIntegrationTestCase.java +++ b/spring-ws-core/src/test/java/org/springframework/ws/client/core/AbstractSoap11WebServiceTemplateIntegrationTestCase.java @@ -255,6 +255,7 @@ public abstract class AbstractSoap11WebServiceTemplateIntegrationTestCase { } /** Servlet that returns and error message for a given status code. */ + @SuppressWarnings("serial") private static class ErrorServlet extends HttpServlet { private int sc; @@ -270,6 +271,7 @@ public abstract class AbstractSoap11WebServiceTemplateIntegrationTestCase { } /** Abstract SOAP Servlet */ + @SuppressWarnings("serial") private abstract static class AbstractSoapServlet extends HttpServlet { protected MessageFactory messageFactory = null; @@ -344,6 +346,7 @@ public abstract class AbstractSoap11WebServiceTemplateIntegrationTestCase { protected abstract SOAPMessage onMessage(SOAPMessage message) throws SOAPException; } + @SuppressWarnings("serial") private static class EchoSoapServlet extends AbstractSoapServlet { @Override @@ -352,6 +355,7 @@ public abstract class AbstractSoap11WebServiceTemplateIntegrationTestCase { } } + @SuppressWarnings("serial") private static class NoResponseSoapServlet extends AbstractSoapServlet { @Override @@ -360,6 +364,7 @@ public abstract class AbstractSoap11WebServiceTemplateIntegrationTestCase { } } + @SuppressWarnings("serial") private static class SoapFaultServlet extends AbstractSoapServlet { @Override @@ -371,6 +376,7 @@ public abstract class AbstractSoap11WebServiceTemplateIntegrationTestCase { } } + @SuppressWarnings("serial") private static class AttachmentsServlet extends AbstractSoapServlet { @Override diff --git a/spring-ws-core/src/test/java/org/springframework/ws/client/core/AbstractSoap12WebServiceTemplateIntegrationTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/client/core/AbstractSoap12WebServiceTemplateIntegrationTestCase.java index ba4ae011..b2364ef2 100644 --- a/spring-ws-core/src/test/java/org/springframework/ws/client/core/AbstractSoap12WebServiceTemplateIntegrationTestCase.java +++ b/spring-ws-core/src/test/java/org/springframework/ws/client/core/AbstractSoap12WebServiceTemplateIntegrationTestCase.java @@ -264,6 +264,7 @@ public abstract class AbstractSoap12WebServiceTemplateIntegrationTestCase { } /** Servlet that returns and error message for a given status code. */ + @SuppressWarnings("serial") private static class ErrorServlet extends HttpServlet { private int sc; @@ -279,12 +280,11 @@ public abstract class AbstractSoap12WebServiceTemplateIntegrationTestCase { } /** Abstract SOAP Servlet */ + @SuppressWarnings("serial") private abstract static class AbstractSoapServlet extends HttpServlet { protected MessageFactory messageFactory = null; - private final int sc = -1; - @Override public void init(ServletConfig servletConfig) throws ServletException { super.init(servletConfig); @@ -358,6 +358,7 @@ public abstract class AbstractSoap12WebServiceTemplateIntegrationTestCase { protected abstract SOAPMessage onMessage(SOAPMessage message) throws SOAPException; } + @SuppressWarnings("serial") private static class EchoSoapServlet extends AbstractSoapServlet { @Override @@ -366,6 +367,7 @@ public abstract class AbstractSoap12WebServiceTemplateIntegrationTestCase { } } + @SuppressWarnings("serial") private static class NoResponseSoapServlet extends AbstractSoapServlet { @Override @@ -374,6 +376,7 @@ public abstract class AbstractSoap12WebServiceTemplateIntegrationTestCase { } } + @SuppressWarnings("serial") private static class SoapReceiverFaultServlet extends AbstractSoapServlet { @Override @@ -385,6 +388,7 @@ public abstract class AbstractSoap12WebServiceTemplateIntegrationTestCase { } } + @SuppressWarnings("serial") private static class SoapSenderFaultServlet extends AbstractSoapServlet { @Override @@ -396,6 +400,7 @@ public abstract class AbstractSoap12WebServiceTemplateIntegrationTestCase { } } + @SuppressWarnings("serial") private static class AttachmentsServlet extends AbstractSoapServlet { @Override diff --git a/spring-ws-core/src/test/java/org/springframework/ws/client/core/DomPoxWebServiceTemplateIntegrationTest.java b/spring-ws-core/src/test/java/org/springframework/ws/client/core/DomPoxWebServiceTemplateIntegrationTest.java index f256066c..d941290c 100644 --- a/spring-ws-core/src/test/java/org/springframework/ws/client/core/DomPoxWebServiceTemplateIntegrationTest.java +++ b/spring-ws-core/src/test/java/org/springframework/ws/client/core/DomPoxWebServiceTemplateIntegrationTest.java @@ -99,6 +99,7 @@ public class DomPoxWebServiceTemplateIntegrationTest { } /** Servlet that returns and error message for a given status code. */ + @SuppressWarnings("serial") private static class ErrorServlet extends HttpServlet { private int sc; @@ -114,6 +115,7 @@ public class DomPoxWebServiceTemplateIntegrationTest { } /** Simple POX Servlet. */ + @SuppressWarnings("serial") private static class PoxServlet extends HttpServlet { private DocumentBuilderFactory documentBuilderFactory; diff --git a/spring-ws-core/src/test/java/org/springframework/ws/client/core/SimpleSaajServlet.java b/spring-ws-core/src/test/java/org/springframework/ws/client/core/SimpleSaajServlet.java index 7cdb64d5..d334b344 100644 --- a/spring-ws-core/src/test/java/org/springframework/ws/client/core/SimpleSaajServlet.java +++ b/spring-ws-core/src/test/java/org/springframework/ws/client/core/SimpleSaajServlet.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,6 +39,7 @@ import org.springframework.util.StringUtils; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public class SimpleSaajServlet extends HttpServlet { private MessageFactory msgFactory = null; diff --git a/spring-ws-core/src/test/java/org/springframework/ws/client/core/WebServiceTemplateTest.java b/spring-ws-core/src/test/java/org/springframework/ws/client/core/WebServiceTemplateTest.java index b4d22a45..7a34ea90 100644 --- a/spring-ws-core/src/test/java/org/springframework/ws/client/core/WebServiceTemplateTest.java +++ b/spring-ws-core/src/test/java/org/springframework/ws/client/core/WebServiceTemplateTest.java @@ -42,6 +42,7 @@ import org.springframework.ws.transport.WebServiceMessageSender; import org.springframework.xml.transform.StringResult; import org.springframework.xml.transform.StringSource; +@SuppressWarnings("unchecked") public class WebServiceTemplateTest { private WebServiceTemplate template; diff --git a/spring-ws-core/src/test/java/org/springframework/ws/client/support/interceptor/PayloadValidatingInterceptorTest.java b/spring-ws-core/src/test/java/org/springframework/ws/client/support/interceptor/PayloadValidatingInterceptorTest.java index 2e76a528..c3fb8055 100644 --- a/spring-ws-core/src/test/java/org/springframework/ws/client/support/interceptor/PayloadValidatingInterceptorTest.java +++ b/spring-ws-core/src/test/java/org/springframework/ws/client/support/interceptor/PayloadValidatingInterceptorTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,10 @@ import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.stream.StreamSource; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; import org.springframework.ws.MockWebServiceMessage; @@ -38,10 +42,6 @@ import org.springframework.ws.soap.saaj.SaajSoapMessageFactory; import org.springframework.ws.soap.saaj.support.SaajUtils; import org.springframework.xml.xsd.SimpleXsdSchema; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - public class PayloadValidatingInterceptorTest { private PayloadValidatingInterceptor interceptor; @@ -81,7 +81,7 @@ public class PayloadValidatingInterceptorTest { @Test public void testHandleInvalidRequest() throws Exception { - SoapMessage invalidMessage = (SoapMessage) soap11Factory.createWebServiceMessage(); + SoapMessage invalidMessage = soap11Factory.createWebServiceMessage(); InputStream inputStream = getClass().getResourceAsStream(INVALID_MESSAGE); transformer.transform(new StreamSource(inputStream), invalidMessage.getPayloadResult()); context = new DefaultMessageContext(invalidMessage, soap11Factory); diff --git a/spring-ws-core/src/test/java/org/springframework/ws/mime/AbstractMimeMessageTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/mime/AbstractMimeMessageTestCase.java index 5c5c7f55..ef0a5c89 100644 --- a/spring-ws-core/src/test/java/org/springframework/ws/mime/AbstractMimeMessageTestCase.java +++ b/spring-ws-core/src/test/java/org/springframework/ws/mime/AbstractMimeMessageTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,16 +19,15 @@ package org.springframework.ws.mime; import java.io.IOException; import java.util.Iterator; +import static org.junit.Assert.*; +import org.junit.Test; + import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; import org.springframework.util.FileCopyUtils; import org.springframework.ws.AbstractWebServiceMessageTestCase; import org.springframework.ws.WebServiceMessage; -import org.junit.Test; - -import static org.junit.Assert.*; - public abstract class AbstractMimeMessageTestCase extends AbstractWebServiceMessageTestCase { protected MimeMessage mimeMessage; @@ -76,7 +75,7 @@ public abstract class AbstractMimeMessageTestCase extends AbstractWebServiceMess Iterator iterator = mimeMessage.getAttachments(); assertNotNull("Attachment iterator is null", iterator); assertTrue("Attachment iterator has no elements", iterator.hasNext()); - Attachment attachment = (Attachment) iterator.next(); + Attachment attachment = iterator.next(); testAttachment(attachment); assertFalse("Attachment iterator has too many elements", iterator.hasNext()); } diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/interceptor/PayloadTransformingInterceptorTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/interceptor/PayloadTransformingInterceptorTest.java index f9528d0e..442cd51a 100644 --- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/interceptor/PayloadTransformingInterceptorTest.java +++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/interceptor/PayloadTransformingInterceptorTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,12 @@ import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.sax.SAXSource; +import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual; +import org.custommonkey.xmlunit.XMLUnit; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; import org.springframework.ws.MockWebServiceMessage; @@ -36,13 +42,6 @@ import org.springframework.xml.sax.SaxUtils; import org.springframework.xml.transform.ResourceSource; import org.springframework.xml.transform.StringResult; -import org.custommonkey.xmlunit.XMLUnit; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - -import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual; - public class PayloadTransformingInterceptorTest { private PayloadTransformingInterceptor interceptor; @@ -150,7 +149,7 @@ public class PayloadTransformingInterceptorTest { interceptor.setRequestXslt(xslt); interceptor.afterPropertiesSet(); DomPoxMessageFactory factory = new DomPoxMessageFactory(); - DomPoxMessage message = (DomPoxMessage) factory.createWebServiceMessage(); + DomPoxMessage message = factory.createWebServiceMessage(); transformer.transform(new ResourceSource(input), message.getPayloadResult()); MessageContext context = new DefaultMessageContext(message, factory); diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/axiom/AxiomSoap11BodyTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/axiom/AxiomSoap11BodyTest.java index b4290837..3d4fc618 100644 --- a/spring-ws-core/src/test/java/org/springframework/ws/soap/axiom/AxiomSoap11BodyTest.java +++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/axiom/AxiomSoap11BodyTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,15 +16,15 @@ package org.springframework.ws.soap.axiom; +import org.apache.axiom.om.OMAbstractFactory; +import org.apache.axiom.soap.SOAPFactory; +import org.junit.Test; + import org.springframework.ws.soap.SoapBody; import org.springframework.ws.soap.SoapVersion; import org.springframework.ws.soap.soap11.AbstractSoap11BodyTestCase; import org.springframework.xml.transform.StringSource; -import org.apache.axiom.om.OMAbstractFactory; -import org.apache.axiom.soap.SOAPFactory; -import org.junit.Test; - public class AxiomSoap11BodyTest extends AbstractSoap11BodyTestCase { @Override @@ -40,7 +40,7 @@ public class AxiomSoap11BodyTest extends AbstractSoap11BodyTestCase { messageFactory.setPayloadCaching(false); messageFactory.setSoapVersion(SoapVersion.SOAP_11); - AxiomSoapMessage axiomSoapMessage = (AxiomSoapMessage) messageFactory.createWebServiceMessage(); + AxiomSoapMessage axiomSoapMessage = messageFactory.createWebServiceMessage(); soapBody = axiomSoapMessage.getSoapBody(); String payload = ""; diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/axiom/AxiomSoap11NonCachingBodyTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/axiom/AxiomSoap11NonCachingBodyTest.java index e108d662..36f2de7d 100644 --- a/spring-ws-core/src/test/java/org/springframework/ws/soap/axiom/AxiomSoap11NonCachingBodyTest.java +++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/axiom/AxiomSoap11NonCachingBodyTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ public class AxiomSoap11NonCachingBodyTest extends AbstractSoap11BodyTestCase { messageFactory.setPayloadCaching(false); messageFactory.setSoapVersion(SoapVersion.SOAP_11); - AxiomSoapMessage axiomSoapMessage = (AxiomSoapMessage) messageFactory.createWebServiceMessage(); + AxiomSoapMessage axiomSoapMessage = messageFactory.createWebServiceMessage(); return axiomSoapMessage.getSoapBody(); } diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/axiom/AxiomSoap11NonCachingMessageTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/axiom/AxiomSoap11NonCachingMessageTest.java index ac93d27a..50e481e4 100644 --- a/spring-ws-core/src/test/java/org/springframework/ws/soap/axiom/AxiomSoap11NonCachingMessageTest.java +++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/axiom/AxiomSoap11NonCachingMessageTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,15 +16,14 @@ package org.springframework.ws.soap.axiom; +import org.apache.axiom.om.impl.llom.OMSourcedElementImpl; +import static org.junit.Assert.*; + import org.springframework.ws.soap.SoapBody; import org.springframework.ws.soap.SoapMessage; import org.springframework.ws.soap.SoapVersion; import org.springframework.ws.soap.soap11.AbstractSoap11MessageTestCase; -import org.apache.axiom.om.impl.llom.OMSourcedElementImpl; - -import static org.junit.Assert.*; - public class AxiomSoap11NonCachingMessageTest extends AbstractSoap11MessageTestCase { @Override @@ -33,7 +32,7 @@ public class AxiomSoap11NonCachingMessageTest extends AbstractSoap11MessageTestC messageFactory.setPayloadCaching(false); messageFactory.setSoapVersion(SoapVersion.SOAP_11); - return (SoapMessage) messageFactory.createWebServiceMessage(); + return messageFactory.createWebServiceMessage(); } @Override diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/axiom/AxiomSoap12BodyTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/axiom/AxiomSoap12BodyTest.java index 1e2bbf66..b5a29811 100644 --- a/spring-ws-core/src/test/java/org/springframework/ws/soap/axiom/AxiomSoap12BodyTest.java +++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/axiom/AxiomSoap12BodyTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,15 +16,15 @@ package org.springframework.ws.soap.axiom; +import org.apache.axiom.om.OMAbstractFactory; +import org.apache.axiom.soap.SOAPFactory; +import org.junit.Test; + import org.springframework.ws.soap.SoapBody; import org.springframework.ws.soap.SoapVersion; import org.springframework.ws.soap.soap12.AbstractSoap12BodyTestCase; import org.springframework.xml.transform.StringSource; -import org.apache.axiom.om.OMAbstractFactory; -import org.apache.axiom.soap.SOAPFactory; -import org.junit.Test; - public class AxiomSoap12BodyTest extends AbstractSoap12BodyTestCase { @Override @@ -40,7 +40,7 @@ public class AxiomSoap12BodyTest extends AbstractSoap12BodyTestCase { messageFactory.setPayloadCaching(false); messageFactory.setSoapVersion(SoapVersion.SOAP_12); - AxiomSoapMessage axiomSoapMessage = (AxiomSoapMessage) messageFactory.createWebServiceMessage(); + AxiomSoapMessage axiomSoapMessage = messageFactory.createWebServiceMessage(); soapBody = axiomSoapMessage.getSoapBody(); String payload = ""; diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/axiom/AxiomSoap12NonCachingBodyTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/axiom/AxiomSoap12NonCachingBodyTest.java index d07c347a..fb20ccbb 100644 --- a/spring-ws-core/src/test/java/org/springframework/ws/soap/axiom/AxiomSoap12NonCachingBodyTest.java +++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/axiom/AxiomSoap12NonCachingBodyTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ public class AxiomSoap12NonCachingBodyTest extends AbstractSoap12BodyTestCase { messageFactory.setPayloadCaching(false); messageFactory.setSoapVersion(SoapVersion.SOAP_12); - AxiomSoapMessage axiomSoapMessage = (AxiomSoapMessage) messageFactory.createWebServiceMessage(); + AxiomSoapMessage axiomSoapMessage = messageFactory.createWebServiceMessage(); return axiomSoapMessage.getSoapBody(); } diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/SoapFaultAnnotationExceptionResolverTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/SoapFaultAnnotationExceptionResolverTest.java index afe6a619..ae4cd12c 100644 --- a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/SoapFaultAnnotationExceptionResolverTest.java +++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/SoapFaultAnnotationExceptionResolverTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,10 @@ import javax.xml.soap.MessageFactory; import javax.xml.soap.SOAPConstants; import javax.xml.soap.SOAPMessage; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + import org.springframework.ws.context.DefaultMessageContext; import org.springframework.ws.context.MessageContext; import org.springframework.ws.soap.SoapMessage; @@ -34,10 +38,6 @@ import org.springframework.ws.soap.server.endpoint.annotation.SoapFault; import org.springframework.ws.soap.soap11.Soap11Fault; import org.springframework.ws.soap.soap12.Soap12Fault; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - public class SoapFaultAnnotationExceptionResolverTest { private SoapFaultAnnotationExceptionResolver resolver; @@ -197,15 +197,18 @@ public class SoapFaultAnnotationExceptionResolverTest { } @SoapFault(faultCode = FaultCode.CLIENT, faultStringOrReason = "Client error") + @SuppressWarnings("serial") public class MyClientException extends Exception { } + @SuppressWarnings("serial") public class MySubClientException extends MyClientException { } @SoapFault(faultCode = FaultCode.CLIENT) + @SuppressWarnings("serial") public class NoStringOrReasonException extends Exception { public NoStringOrReasonException(String message) { @@ -214,26 +217,31 @@ public class SoapFaultAnnotationExceptionResolverTest { } @SoapFault(faultCode = FaultCode.SENDER, faultStringOrReason = "Sender error") + @SuppressWarnings("serial") public class MySenderException extends Exception { } @SoapFault(faultCode = FaultCode.SERVER, faultStringOrReason = "Server error") + @SuppressWarnings("serial") public class MyServerException extends Exception { } @SoapFault(faultCode = FaultCode.RECEIVER, faultStringOrReason = "Receiver error") + @SuppressWarnings("serial") public class MyReceiverException extends Exception { } @SoapFault(faultCode = FaultCode.CUSTOM, customFaultCode = "{http://springframework.org/spring-ws}Fault", faultStringOrReason = "MyCustomException thrown", locale = "nl") + @SuppressWarnings("serial") public class MyCustomException extends Exception { } + @SuppressWarnings("serial") public class NonAnnotatedException extends Exception { } diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/interceptor/PayloadValidatingInterceptorTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/interceptor/PayloadValidatingInterceptorTest.java index 56ff9f94..075ff0eb 100644 --- a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/interceptor/PayloadValidatingInterceptorTest.java +++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/interceptor/PayloadValidatingInterceptorTest.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2011 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -27,6 +27,14 @@ import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.stream.StreamSource; +import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; +import org.xml.sax.helpers.LocatorImpl; + import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; import org.springframework.ws.MockWebServiceMessage; @@ -47,15 +55,6 @@ import org.springframework.ws.transport.TransportInputStream; import org.springframework.xml.validation.ValidationErrorHandler; import org.springframework.xml.xsd.SimpleXsdSchema; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.xml.sax.SAXException; -import org.xml.sax.SAXParseException; -import org.xml.sax.helpers.LocatorImpl; - -import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual; - public class PayloadValidatingInterceptorTest { private PayloadValidatingInterceptor interceptor; @@ -143,7 +142,7 @@ public class PayloadValidatingInterceptorTest { interceptor.setFaultStringOrReasonLocale(locale); interceptor.setAddValidationErrorDetail(false); - SoapMessage invalidMessage = (SoapMessage) soap11Factory.createWebServiceMessage(); + SoapMessage invalidMessage = soap11Factory.createWebServiceMessage(); InputStream inputStream = getClass().getResourceAsStream(INVALID_MESSAGE); transformer.transform(new StreamSource(inputStream), invalidMessage.getPayloadResult()); context = new DefaultMessageContext(invalidMessage, soap11Factory); diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11HeaderTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11HeaderTestCase.java index 0f7487b4..2d8c05a4 100644 --- a/spring-ws-core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11HeaderTestCase.java +++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11HeaderTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,16 +19,15 @@ package org.springframework.ws.soap.soap11; import java.util.Iterator; import javax.xml.namespace.QName; +import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual; +import static org.junit.Assert.*; +import org.junit.Test; + import org.springframework.ws.soap.AbstractSoapHeaderTestCase; import org.springframework.ws.soap.SoapHeaderElement; import org.springframework.ws.soap.SoapVersion; import org.springframework.xml.transform.StringResult; -import org.junit.Test; - -import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual; -import static org.junit.Assert.*; - public abstract class AbstractSoap11HeaderTestCase extends AbstractSoapHeaderTestCase { private static final String PREFIX = "spring"; @@ -66,9 +65,9 @@ public abstract class AbstractSoap11HeaderTestCase extends AbstractSoapHeaderTes Iterator iterator = ((Soap11Header) soapHeader).examineHeaderElementsToProcess(new String[]{"role1"}); assertNotNull("header element iterator is null", iterator); assertTrue("header element iterator has no elements", iterator.hasNext()); - checkHeaderElement((SoapHeaderElement) iterator.next()); + checkHeaderElement(iterator.next()); assertTrue("header element iterator has no elements", iterator.hasNext()); - checkHeaderElement((SoapHeaderElement) iterator.next()); + checkHeaderElement(iterator.next()); assertFalse("header element iterator has too many elements", iterator.hasNext()); } @@ -86,9 +85,9 @@ public abstract class AbstractSoap11HeaderTestCase extends AbstractSoapHeaderTes Iterator iterator = ((Soap11Header) soapHeader).examineHeaderElementsToProcess(new String[0]); assertNotNull("header element iterator is null", iterator); assertTrue("header element iterator has no elements", iterator.hasNext()); - checkHeaderElement((SoapHeaderElement) iterator.next()); + checkHeaderElement(iterator.next()); assertTrue("header element iterator has no elements", iterator.hasNext()); - checkHeaderElement((SoapHeaderElement) iterator.next()); + checkHeaderElement(iterator.next()); assertFalse("header element iterator has too many elements", iterator.hasNext()); } diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11MessageTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11MessageTestCase.java index c0da63ac..f77c863d 100644 --- a/spring-ws-core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11MessageTestCase.java +++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11MessageTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,12 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.transform.dom.DOMResult; import javax.xml.transform.stream.StreamSource; +import junit.framework.Assert; +import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual; +import static org.junit.Assert.*; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + import org.springframework.core.io.ByteArrayResource; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.InputStreamSource; @@ -33,13 +39,6 @@ import org.springframework.ws.soap.SoapVersion; import org.springframework.ws.transport.MockTransportOutputStream; import org.springframework.xml.transform.StringSource; -import junit.framework.Assert; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual; -import static org.junit.Assert.*; - public abstract class AbstractSoap11MessageTestCase extends AbstractSoapMessageTestCase { @Override @@ -67,11 +66,11 @@ public abstract class AbstractSoap11MessageTestCase extends AbstractSoapMessageT assertXMLEqual( "", result); - String contentType = (String) tos.getHeaders().get("Content-Type"); + String contentType = tos.getHeaders().get("Content-Type"); assertTrue("Invalid Content-Type set", contentType.indexOf(SoapVersion.SOAP_11.getContentType()) != -1); - String resultSoapAction = (String) tos.getHeaders().get("SOAPAction"); + String resultSoapAction = tos.getHeaders().get("SOAPAction"); assertEquals("Invalid soap action", "\"" + soapAction + "\"", resultSoapAction); - String resultAccept = (String) tos.getHeaders().get("Accept"); + String resultAccept = tos.getHeaders().get("Accept"); assertNotNull("Invalid accept header", resultAccept); } @@ -82,7 +81,7 @@ public abstract class AbstractSoap11MessageTestCase extends AbstractSoapMessageT ByteArrayOutputStream bos = new ByteArrayOutputStream(); MockTransportOutputStream tos = new MockTransportOutputStream(bos); soapMessage.writeTo(tos); - String contentType = (String) tos.getHeaders().get("Content-Type"); + String contentType = tos.getHeaders().get("Content-Type"); assertTrue("Content-Type for attachment message does not contains multipart/related", contentType.indexOf("multipart/related") != -1); assertTrue("Content-Type for attachment message does not contains type=\"text/xml\"", diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/soap12/AbstractSoap12HeaderTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/soap12/AbstractSoap12HeaderTestCase.java index d1486ebb..fc6d3fc6 100644 --- a/spring-ws-core/src/test/java/org/springframework/ws/soap/soap12/AbstractSoap12HeaderTestCase.java +++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/soap12/AbstractSoap12HeaderTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,16 +19,15 @@ package org.springframework.ws.soap.soap12; import java.util.Iterator; import javax.xml.namespace.QName; +import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual; +import static org.junit.Assert.*; +import org.junit.Test; + import org.springframework.ws.soap.AbstractSoapHeaderTestCase; import org.springframework.ws.soap.SoapHeaderElement; import org.springframework.ws.soap.SoapVersion; import org.springframework.xml.transform.StringResult; -import org.junit.Test; - -import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual; -import static org.junit.Assert.*; - public abstract class AbstractSoap12HeaderTestCase extends AbstractSoapHeaderTestCase { @Test @@ -96,9 +95,9 @@ public abstract class AbstractSoap12HeaderTestCase extends AbstractSoapHeaderTes Iterator iterator = ((Soap12Header) soapHeader).examineHeaderElementsToProcess(new String[]{"role1"}, false); assertNotNull("header element iterator is null", iterator); assertTrue("header element iterator has no elements", iterator.hasNext()); - checkHeaderElement((SoapHeaderElement) iterator.next()); + checkHeaderElement(iterator.next()); assertTrue("header element iterator has no elements", iterator.hasNext()); - checkHeaderElement((SoapHeaderElement) iterator.next()); + checkHeaderElement(iterator.next()); assertFalse("header element iterator has too many elements", iterator.hasNext()); } @@ -116,9 +115,9 @@ public abstract class AbstractSoap12HeaderTestCase extends AbstractSoapHeaderTes Iterator iterator = ((Soap12Header) soapHeader).examineHeaderElementsToProcess(new String[0], false); assertNotNull("header element iterator is null", iterator); assertTrue("header element iterator has no elements", iterator.hasNext()); - checkHeaderElement((SoapHeaderElement) iterator.next()); + checkHeaderElement(iterator.next()); assertTrue("header element iterator has no elements", iterator.hasNext()); - checkHeaderElement((SoapHeaderElement) iterator.next()); + checkHeaderElement(iterator.next()); assertFalse("header element iterator has too many elements", iterator.hasNext()); } @@ -129,7 +128,7 @@ public abstract class AbstractSoap12HeaderTestCase extends AbstractSoapHeaderTes headerElement.setActorOrRole(SoapVersion.SOAP_12.getUltimateReceiverRoleUri()); Iterator iterator = ((Soap12Header) soapHeader).examineHeaderElementsToProcess(new String[]{"role"}, true); assertNotNull("header element iterator is null", iterator); - headerElement = (SoapHeaderElement) iterator.next(); + headerElement = iterator.next(); assertEquals("Invalid name on header element", new QName(NAMESPACE, "localName", PREFIX), headerElement.getName()); assertFalse("header element iterator has too many elements", iterator.hasNext()); diff --git a/spring-ws-core/src/test/java/org/springframework/ws/transport/http/AbstractHttpWebServiceMessageSenderIntegrationTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/transport/http/AbstractHttpWebServiceMessageSenderIntegrationTestCase.java index 6d0ad55d..abd799eb 100644 --- a/spring-ws-core/src/test/java/org/springframework/ws/transport/http/AbstractHttpWebServiceMessageSenderIntegrationTestCase.java +++ b/spring-ws-core/src/test/java/org/springframework/ws/transport/http/AbstractHttpWebServiceMessageSenderIntegrationTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,6 +36,17 @@ import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMResult; +import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual; +import org.custommonkey.xmlunit.XMLUnit; +import org.junit.After; +import org.junit.Assert; +import static org.junit.Assert.assertEquals; +import org.junit.Before; +import org.junit.Test; +import org.mortbay.jetty.Server; +import org.mortbay.jetty.servlet.Context; +import org.mortbay.jetty.servlet.ServletHolder; + import org.springframework.beans.factory.InitializingBean; import org.springframework.util.FileCopyUtils; import org.springframework.ws.WebServiceMessage; @@ -48,18 +59,6 @@ import org.springframework.ws.transport.support.FreePortScanner; import org.springframework.xml.transform.StringResult; import org.springframework.xml.transform.StringSource; -import org.custommonkey.xmlunit.XMLUnit; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.mortbay.jetty.Server; -import org.mortbay.jetty.servlet.Context; -import org.mortbay.jetty.servlet.ServletHolder; - -import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual; -import static org.junit.Assert.assertEquals; - public abstract class AbstractHttpWebServiceMessageSenderIntegrationTestCase { private Server jettyServer; @@ -241,6 +240,7 @@ public abstract class AbstractHttpWebServiceMessageSenderIntegrationTestCase { return request; } + @SuppressWarnings("serial") private class MyServlet extends HttpServlet { private int responseStatus = HttpServletResponse.SC_OK; diff --git a/spring-ws-core/src/test/java/org/springframework/ws/transport/http/CommonsHttpMessageSenderIntegrationTest.java b/spring-ws-core/src/test/java/org/springframework/ws/transport/http/CommonsHttpMessageSenderIntegrationTest.java index a070fd63..b95c7ec2 100644 --- a/spring-ws-core/src/test/java/org/springframework/ws/transport/http/CommonsHttpMessageSenderIntegrationTest.java +++ b/spring-ws-core/src/test/java/org/springframework/ws/transport/http/CommonsHttpMessageSenderIntegrationTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,22 +27,19 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.xml.soap.MessageFactory; -import org.springframework.context.support.StaticApplicationContext; -import org.springframework.util.FileCopyUtils; -import org.springframework.ws.MockWebServiceMessage; -import org.springframework.ws.WebServiceMessage; -import org.springframework.ws.soap.saaj.SaajSoapMessage; -import org.springframework.ws.soap.saaj.SaajSoapMessageFactory; -import org.springframework.ws.transport.WebServiceConnection; -import org.springframework.ws.transport.support.FreePortScanner; - -import org.apache.commons.httpclient.ConnectTimeoutException; import org.apache.commons.httpclient.URIException; import org.junit.Test; import org.mortbay.jetty.Server; import org.mortbay.jetty.servlet.Context; import org.mortbay.jetty.servlet.ServletHolder; +import org.springframework.context.support.StaticApplicationContext; +import org.springframework.util.FileCopyUtils; +import org.springframework.ws.soap.saaj.SaajSoapMessage; +import org.springframework.ws.soap.saaj.SaajSoapMessageFactory; +import org.springframework.ws.transport.WebServiceConnection; +import org.springframework.ws.transport.support.FreePortScanner; + public class CommonsHttpMessageSenderIntegrationTest extends AbstractHttpWebServiceMessageSenderIntegrationTestCase { @Override @@ -101,6 +98,7 @@ public class CommonsHttpMessageSenderIntegrationTest extends AbstractHttpWebServ } + @SuppressWarnings("serial") private class EchoServlet extends HttpServlet { @Override diff --git a/spring-ws-core/src/test/java/org/springframework/ws/transport/http/HttpComponentsMessageSenderIntegrationTest.java b/spring-ws-core/src/test/java/org/springframework/ws/transport/http/HttpComponentsMessageSenderIntegrationTest.java index 9d4c639e..b059b4cd 100644 --- a/spring-ws-core/src/test/java/org/springframework/ws/transport/http/HttpComponentsMessageSenderIntegrationTest.java +++ b/spring-ws-core/src/test/java/org/springframework/ws/transport/http/HttpComponentsMessageSenderIntegrationTest.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2012 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -27,6 +27,12 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.xml.soap.MessageFactory; +import org.apache.commons.httpclient.URIException; +import org.junit.Test; +import org.mortbay.jetty.Server; +import org.mortbay.jetty.servlet.Context; +import org.mortbay.jetty.servlet.ServletHolder; + import org.springframework.context.support.StaticApplicationContext; import org.springframework.util.FileCopyUtils; import org.springframework.ws.soap.saaj.SaajSoapMessage; @@ -34,12 +40,6 @@ import org.springframework.ws.soap.saaj.SaajSoapMessageFactory; import org.springframework.ws.transport.WebServiceConnection; import org.springframework.ws.transport.support.FreePortScanner; -import org.apache.commons.httpclient.URIException; -import org.junit.Test; -import org.mortbay.jetty.Server; -import org.mortbay.jetty.servlet.Context; -import org.mortbay.jetty.servlet.ServletHolder; - public class HttpComponentsMessageSenderIntegrationTest extends AbstractHttpWebServiceMessageSenderIntegrationTestCase { @Override @@ -97,6 +97,7 @@ public class HttpComponentsMessageSenderIntegrationTest extends AbstractHttpWebS } + @SuppressWarnings("serial") private class EchoServlet extends HttpServlet { @Override diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/WsSecurityException.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/WsSecurityException.java index b1b1d774..e36e0959 100644 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/WsSecurityException.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/WsSecurityException.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ import org.springframework.ws.WebServiceException; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public abstract class WsSecurityException extends WebServiceException { public WsSecurityException(String msg) { diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/WsSecurityFaultException.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/WsSecurityFaultException.java index 21948d25..9815bdcf 100644 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/WsSecurityFaultException.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/WsSecurityFaultException.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import javax.xml.namespace.QName; * @author Arjen Poutsma * @since 1.0.1 */ +@SuppressWarnings("serial") public abstract class WsSecurityFaultException extends WsSecurityException { private QName faultCode; diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/WsSecuritySecurementException.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/WsSecuritySecurementException.java index f8f09c8a..900142b2 100644 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/WsSecuritySecurementException.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/WsSecuritySecurementException.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ package org.springframework.ws.soap.security; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public abstract class WsSecuritySecurementException extends WsSecurityException { public WsSecuritySecurementException(String msg) { diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/WsSecurityValidationException.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/WsSecurityValidationException.java index b2815d66..890fcd47 100644 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/WsSecurityValidationException.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/WsSecurityValidationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ package org.springframework.ws.soap.security; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public abstract class WsSecurityValidationException extends WsSecurityException { public WsSecurityValidationException(String msg) { diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/support/SpringSecurityUtils.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/support/SpringSecurityUtils.java index ef1e160c..f3f33ede 100644 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/support/SpringSecurityUtils.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/support/SpringSecurityUtils.java @@ -1,10 +1,11 @@ -/* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited +/* + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,11 +16,11 @@ package org.springframework.ws.soap.security.support; -import org.springframework.security.core.userdetails.UserDetails; -import org.springframework.security.authentication.LockedException; -import org.springframework.security.authentication.DisabledException; import org.springframework.security.authentication.AccountExpiredException; import org.springframework.security.authentication.CredentialsExpiredException; +import org.springframework.security.authentication.DisabledException; +import org.springframework.security.authentication.LockedException; +import org.springframework.security.core.userdetails.UserDetails; /** * Generic utility methods for Spring Security @@ -37,6 +38,7 @@ 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()) { diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j/Wss4jSecurityFaultException.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j/Wss4jSecurityFaultException.java index 59172bea..f82f6bf7 100755 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j/Wss4jSecurityFaultException.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j/Wss4jSecurityFaultException.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ import org.springframework.ws.soap.security.WsSecurityFaultException; * @author Arjen Poutsma * @since 1.5.0 */ +@SuppressWarnings("serial") public class Wss4jSecurityFaultException extends WsSecurityFaultException { public Wss4jSecurityFaultException(QName faultCode, String faultString, String faultActor) { diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j/Wss4jSecuritySecurementException.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j/Wss4jSecuritySecurementException.java index 7e8fef6d..2e5feeab 100755 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j/Wss4jSecuritySecurementException.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j/Wss4jSecuritySecurementException.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ import org.springframework.ws.soap.security.WsSecuritySecurementException; * @author Arjen Poutsma * @since 1.5.0 */ +@SuppressWarnings("serial") public class Wss4jSecuritySecurementException extends WsSecuritySecurementException { public Wss4jSecuritySecurementException(String msg) { diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j/Wss4jSecurityValidationException.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j/Wss4jSecurityValidationException.java index 841fa5d1..74af8d75 100755 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j/Wss4jSecurityValidationException.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j/Wss4jSecurityValidationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ import org.springframework.ws.soap.security.WsSecurityValidationException; * @author Arjen Poutsma * @since 1.5.0 */ +@SuppressWarnings("serial") public class Wss4jSecurityValidationException extends WsSecurityValidationException { public Wss4jSecurityValidationException(String msg) { diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/x509/X509AuthenticationProvider.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/x509/X509AuthenticationProvider.java index 70b64634..716bbbf6 100644 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/x509/X509AuthenticationProvider.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/x509/X509AuthenticationProvider.java @@ -126,7 +126,7 @@ public class X509AuthenticationProvider implements AuthenticationProvider, Initi } @Override - public boolean supports(Class authentication) { + public boolean supports(Class authentication) { return X509AuthenticationToken.class.isAssignableFrom(authentication); } } diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/x509/cache/EhCacheBasedX509UserCache.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/x509/cache/EhCacheBasedX509UserCache.java index d27b20d9..63b76056 100644 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/x509/cache/EhCacheBasedX509UserCache.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/x509/cache/EhCacheBasedX509UserCache.java @@ -77,7 +77,7 @@ public class EhCacheBasedX509UserCache implements X509UserCache, InitializingBea if (element == null) { return null; } else { - return (UserDetails) element.getValue(); + return (UserDetails) element.getObjectValue(); } } diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/XwsSecurityFaultException.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/XwsSecurityFaultException.java index 5556cb1c..d4acdcf8 100644 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/XwsSecurityFaultException.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/XwsSecurityFaultException.java @@ -1,3 +1,19 @@ +/* + * Copyright 2005-2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.springframework.ws.soap.security.xwss; import javax.xml.namespace.QName; @@ -10,6 +26,7 @@ import org.springframework.ws.soap.security.WsSecurityFaultException; * @author Arjen Poutsma * @since 1.0.1 */ +@SuppressWarnings("serial") public class XwsSecurityFaultException extends WsSecurityFaultException { public XwsSecurityFaultException(QName faultCode, String faultString, String faultActor) { diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/XwsSecuritySecurementException.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/XwsSecuritySecurementException.java index 44eb3799..6c7f3397 100644 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/XwsSecuritySecurementException.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/XwsSecuritySecurementException.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import org.springframework.ws.soap.security.WsSecuritySecurementException; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public class XwsSecuritySecurementException extends WsSecuritySecurementException { public XwsSecuritySecurementException(String msg) { diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/XwsSecurityValidationException.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/XwsSecurityValidationException.java index 7c8af13e..ed2ec3fd 100644 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/XwsSecurityValidationException.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/XwsSecurityValidationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import org.springframework.ws.soap.security.WsSecurityValidationException; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public class XwsSecurityValidationException extends WsSecurityValidationException { public XwsSecurityValidationException(String msg) { diff --git a/spring-ws-security/src/test/java/org/springframework/ws/soap/security/wss4j/Wss4jMessageInterceptorEncryptionTestCase.java b/spring-ws-security/src/test/java/org/springframework/ws/soap/security/wss4j/Wss4jMessageInterceptorEncryptionTestCase.java index c360c84c..7543f0c0 100755 --- a/spring-ws-security/src/test/java/org/springframework/ws/soap/security/wss4j/Wss4jMessageInterceptorEncryptionTestCase.java +++ b/spring-ws-security/src/test/java/org/springframework/ws/soap/security/wss4j/Wss4jMessageInterceptorEncryptionTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,16 +18,15 @@ package org.springframework.ws.soap.security.wss4j; import java.util.Properties; +import org.junit.Test; +import org.w3c.dom.Document; + import org.springframework.ws.context.DefaultMessageContext; import org.springframework.ws.context.MessageContext; import org.springframework.ws.soap.SoapMessage; import org.springframework.ws.soap.security.wss4j.callback.KeyStoreCallbackHandler; import org.springframework.ws.soap.security.wss4j.support.CryptoFactoryBean; -import org.apache.ws.security.components.crypto.Crypto; -import org.junit.Test; -import org.w3c.dom.Document; - public abstract class Wss4jMessageInterceptorEncryptionTestCase extends Wss4jTestCase { protected Wss4jSecurityInterceptor interceptor; @@ -54,9 +53,9 @@ public abstract class Wss4jMessageInterceptorEncryptionTestCase extends Wss4jTes cryptoFactoryBeanConfig.setProperty("org.apache.ws.security.crypto.merlin.file", "private.jks"); cryptoFactoryBean.setConfiguration(cryptoFactoryBeanConfig); cryptoFactoryBean.afterPropertiesSet(); - interceptor.setValidationDecryptionCrypto((Crypto) cryptoFactoryBean + interceptor.setValidationDecryptionCrypto(cryptoFactoryBean .getObject()); - interceptor.setSecurementEncryptionCrypto((Crypto) cryptoFactoryBean + interceptor.setSecurementEncryptionCrypto(cryptoFactoryBean .getObject()); interceptor.afterPropertiesSet(); diff --git a/spring-ws-security/src/test/java/org/springframework/ws/soap/security/wss4j/Wss4jMessageInterceptorX509TestCase.java b/spring-ws-security/src/test/java/org/springframework/ws/soap/security/wss4j/Wss4jMessageInterceptorX509TestCase.java index 4bc555d1..b7bd91ff 100644 --- a/spring-ws-security/src/test/java/org/springframework/ws/soap/security/wss4j/Wss4jMessageInterceptorX509TestCase.java +++ b/spring-ws-security/src/test/java/org/springframework/ws/soap/security/wss4j/Wss4jMessageInterceptorX509TestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,16 +16,15 @@ package org.springframework.ws.soap.security.wss4j; +import org.apache.ws.security.components.crypto.Merlin; +import org.junit.Test; +import org.w3c.dom.Document; + import org.springframework.core.io.ClassPathResource; import org.springframework.ws.context.MessageContext; import org.springframework.ws.soap.SoapMessage; import org.springframework.ws.soap.security.wss4j.support.CryptoFactoryBean; -import org.apache.ws.security.components.crypto.Crypto; -import org.apache.ws.security.components.crypto.Merlin; -import org.junit.Test; -import org.w3c.dom.Document; - public abstract class Wss4jMessageInterceptorX509TestCase extends Wss4jTestCase { protected Wss4jSecurityInterceptor interceptor; @@ -42,9 +41,9 @@ public abstract class Wss4jMessageInterceptorX509TestCase extends Wss4jTestCase cryptoFactoryBean.setKeyStoreLocation(new ClassPathResource("private.jks")); cryptoFactoryBean.afterPropertiesSet(); - interceptor.setSecurementSignatureCrypto((Crypto) cryptoFactoryBean + interceptor.setSecurementSignatureCrypto(cryptoFactoryBean .getObject()); - interceptor.setValidationSignatureCrypto((Crypto) cryptoFactoryBean + interceptor.setValidationSignatureCrypto(cryptoFactoryBean .getObject()); interceptor.afterPropertiesSet(); diff --git a/spring-ws-security/src/test/java/org/springframework/ws/soap/security/xwss/callback/jaas/PlainTextLoginModule.java b/spring-ws-security/src/test/java/org/springframework/ws/soap/security/xwss/callback/jaas/PlainTextLoginModule.java index 91cd8df9..69571d37 100644 --- a/spring-ws-security/src/test/java/org/springframework/ws/soap/security/xwss/callback/jaas/PlainTextLoginModule.java +++ b/spring-ws-security/src/test/java/org/springframework/ws/soap/security/xwss/callback/jaas/PlainTextLoginModule.java @@ -16,6 +16,7 @@ package org.springframework.ws.soap.security.xwss.callback.jaas; +import java.security.Principal; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -35,7 +36,7 @@ public class PlainTextLoginModule implements LoginModule { private boolean success; - private List principals = new ArrayList(); + private List principals = new ArrayList(); @Override public boolean abort() { diff --git a/spring-ws-support/src/main/java/org/springframework/ws/transport/http/HttpExchangeConnection.java b/spring-ws-support/src/main/java/org/springframework/ws/transport/http/HttpExchangeConnection.java index 23a908e9..cad7ef05 100644 --- a/spring-ws-support/src/main/java/org/springframework/ws/transport/http/HttpExchangeConnection.java +++ b/spring-ws-support/src/main/java/org/springframework/ws/transport/http/HttpExchangeConnection.java @@ -167,6 +167,7 @@ public class HttpExchangeConnection extends AbstractReceiverConnection } @Override + @Deprecated public void setFault(boolean fault) throws IOException { if (fault) { responseStatusCode = HttpTransportConstants.STATUS_INTERNAL_SERVER_ERROR; diff --git a/spring-ws-support/src/main/java/org/springframework/ws/transport/http/HttpsTransportException.java b/spring-ws-support/src/main/java/org/springframework/ws/transport/http/HttpsTransportException.java index 9f721696..d2c53fd2 100644 --- a/spring-ws-support/src/main/java/org/springframework/ws/transport/http/HttpsTransportException.java +++ b/spring-ws-support/src/main/java/org/springframework/ws/transport/http/HttpsTransportException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ package org.springframework.ws.transport.http; * @author Arjen Poutsma * @since 1.5.8 */ +@SuppressWarnings("serial") public class HttpsTransportException extends HttpTransportException { public HttpsTransportException(String msg) { diff --git a/spring-ws-support/src/main/java/org/springframework/ws/transport/jms/JmsTransportException.java b/spring-ws-support/src/main/java/org/springframework/ws/transport/jms/JmsTransportException.java index 72fd91fb..c24d61ba 100644 --- a/spring-ws-support/src/main/java/org/springframework/ws/transport/jms/JmsTransportException.java +++ b/spring-ws-support/src/main/java/org/springframework/ws/transport/jms/JmsTransportException.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,6 +26,7 @@ import org.springframework.ws.transport.TransportException; * @author Arjen Poutsma * @since 1.5.0 */ +@SuppressWarnings("serial") public class JmsTransportException extends TransportException { private final JMSException jmsException; diff --git a/spring-ws-support/src/main/java/org/springframework/ws/transport/mail/MailTransportException.java b/spring-ws-support/src/main/java/org/springframework/ws/transport/mail/MailTransportException.java index 8c940cb1..b0ea8059 100644 --- a/spring-ws-support/src/main/java/org/springframework/ws/transport/mail/MailTransportException.java +++ b/spring-ws-support/src/main/java/org/springframework/ws/transport/mail/MailTransportException.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,6 +26,7 @@ import org.springframework.ws.transport.TransportException; * @author Arjen Poutsma * @since 1.5.0 */ +@SuppressWarnings("serial") public class MailTransportException extends TransportException { private final MessagingException messagingException; diff --git a/spring-ws-test/src/main/java/org/springframework/ws/test/support/SourceAssertionError.java b/spring-ws-test/src/main/java/org/springframework/ws/test/support/SourceAssertionError.java index 01d5e21a..0ce9c0e3 100644 --- a/spring-ws-test/src/main/java/org/springframework/ws/test/support/SourceAssertionError.java +++ b/spring-ws-test/src/main/java/org/springframework/ws/test/support/SourceAssertionError.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2011 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -32,6 +32,7 @@ import org.springframework.xml.transform.TransformerHelper; * @author Arjen Poutsma * @since 2.0.1 */ +@SuppressWarnings("serial") public class SourceAssertionError extends AssertionError { private final String sourceLabel; diff --git a/spring-xml/src/main/java/org/springframework/xml/XmlException.java b/spring-xml/src/main/java/org/springframework/xml/XmlException.java index 9636a255..427c1eac 100644 --- a/spring-xml/src/main/java/org/springframework/xml/XmlException.java +++ b/spring-xml/src/main/java/org/springframework/xml/XmlException.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import org.springframework.core.NestedRuntimeException; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public abstract class XmlException extends NestedRuntimeException { /** diff --git a/spring-xml/src/main/java/org/springframework/xml/namespace/QNameEditor.java b/spring-xml/src/main/java/org/springframework/xml/namespace/QNameEditor.java index 9c7e5f54..774c0db7 100644 --- a/spring-xml/src/main/java/org/springframework/xml/namespace/QNameEditor.java +++ b/spring-xml/src/main/java/org/springframework/xml/namespace/QNameEditor.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -60,7 +60,7 @@ public class QNameEditor extends PropertyEditorSupport { } else { QName qName = (QName) value; - String prefix = QNameUtils.getPrefix(qName); + String prefix = qName.getPrefix(); if (StringUtils.hasLength(qName.getNamespaceURI()) && StringUtils.hasLength(prefix)) { return "{" + qName.getNamespaceURI() + "}" + prefix + ":" + qName.getLocalPart(); } diff --git a/spring-xml/src/main/java/org/springframework/xml/namespace/QNameUtils.java b/spring-xml/src/main/java/org/springframework/xml/namespace/QNameUtils.java index 695e47c9..748002dd 100644 --- a/spring-xml/src/main/java/org/springframework/xml/namespace/QNameUtils.java +++ b/spring-xml/src/main/java/org/springframework/xml/namespace/QNameUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,11 +18,11 @@ package org.springframework.xml.namespace; import javax.xml.namespace.QName; +import org.w3c.dom.Node; + import org.springframework.util.Assert; import org.springframework.util.StringUtils; -import org.w3c.dom.Node; - /** * Helper class for using {@link QName}. * @@ -32,20 +32,7 @@ import org.w3c.dom.Node; */ public abstract class QNameUtils { - /** Indicates whether {@link QName} has a prefix. The first release of the class did not have this. */ - private static boolean qNameHasPrefix; - - static { - try { - QName.class.getDeclaredConstructor(new Class[]{String.class, String.class, String.class}); - qNameHasPrefix = true; - } - catch (NoSuchMethodException e) { - qNameHasPrefix = false; - } - } - - /** + /** * Creates a new {@code QName} with the given parameters. Sets the prefix if possible, i.e. if the * {@code QName(String, String, String)} constructor can be found. If this constructor is not available (as is * the case on older implementations of JAX-RPC), the prefix is ignored. @@ -55,14 +42,11 @@ public abstract class QNameUtils { * @param prefix prefix of the {@code QName}. May be ignored. * @return the created {@code QName} * @see QName#QName(String,String,String) + * @deprecated in favor of {@link QName#QName(String, String, String)} */ + @Deprecated public static QName createQName(String namespaceUri, String localPart, String prefix) { - if (qNameHasPrefix) { - return new QName(namespaceUri, localPart, prefix); - } - else { - return new QName(namespaceUri, localPart); - } + return new QName(namespaceUri, localPart, prefix); } /** @@ -73,9 +57,11 @@ public abstract class QNameUtils { * @param qName the {@code QName} to return the prefix from * @return the prefix, if available, or an empty string * @see javax.xml.namespace.QName#getPrefix() + * @deprecated in favor of {@link QName#getPrefix()} */ + @Deprecated public static String getPrefix(QName qName) { - return qNameHasPrefix ? qName.getPrefix() : ""; + return qName.getPrefix(); } /** @@ -106,7 +92,8 @@ public abstract class QNameUtils { */ public static QName getQNameForNode(Node node) { if (node.getNamespaceURI() != null && node.getPrefix() != null && node.getLocalName() != null) { - return createQName(node.getNamespaceURI(), node.getLocalName(), node.getPrefix()); + return new QName(node.getNamespaceURI(), node.getLocalName(), + node.getPrefix()); } else if (node.getNamespaceURI() != null && node.getLocalName() != null) { return new QName(node.getNamespaceURI(), node.getLocalName()); @@ -128,7 +115,7 @@ public abstract class QNameUtils { * @return the qualified name */ public static String toQualifiedName(QName qName) { - String prefix = getPrefix(qName); + String prefix = qName.getPrefix(); if (!StringUtils.hasLength(prefix)) { return qName.getLocalPart(); } @@ -151,7 +138,8 @@ public abstract class QNameUtils { return new QName(namespaceUri, qualifiedName); } else { - return createQName(namespaceUri, qualifiedName.substring(idx + 1), qualifiedName.substring(0, idx)); + return new QName(namespaceUri, qualifiedName.substring(idx + 1), + qualifiedName.substring(0, idx)); } } @@ -181,8 +169,8 @@ public abstract class QNameUtils { return new QName(namespaceURI, qNameString.substring(endOfNamespaceURI + 1)); } else { - return createQName(namespaceURI, qNameString.substring(prefixSeperator + 1), - qNameString.substring(endOfNamespaceURI + 1, prefixSeperator)); + return new QName(namespaceURI, qNameString.substring(prefixSeperator + 1), + qNameString.substring(endOfNamespaceURI + 1, prefixSeperator)); } } diff --git a/spring-xml/src/main/java/org/springframework/xml/validation/XmlValidationException.java b/spring-xml/src/main/java/org/springframework/xml/validation/XmlValidationException.java index ff3310ef..34368a5f 100644 --- a/spring-xml/src/main/java/org/springframework/xml/validation/XmlValidationException.java +++ b/spring-xml/src/main/java/org/springframework/xml/validation/XmlValidationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import org.springframework.xml.XmlException; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public class XmlValidationException extends XmlException { public XmlValidationException(String s) { diff --git a/spring-xml/src/main/java/org/springframework/xml/xpath/XPathException.java b/spring-xml/src/main/java/org/springframework/xml/xpath/XPathException.java index a8c033d9..884c9227 100644 --- a/spring-xml/src/main/java/org/springframework/xml/xpath/XPathException.java +++ b/spring-xml/src/main/java/org/springframework/xml/xpath/XPathException.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import org.springframework.xml.XmlException; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public class XPathException extends XmlException { /** diff --git a/spring-xml/src/main/java/org/springframework/xml/xpath/XPathParseException.java b/spring-xml/src/main/java/org/springframework/xml/xpath/XPathParseException.java index 4ad5be52..aca2d81f 100644 --- a/spring-xml/src/main/java/org/springframework/xml/xpath/XPathParseException.java +++ b/spring-xml/src/main/java/org/springframework/xml/xpath/XPathParseException.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ package org.springframework.xml.xpath; * @author Arjen Poutsma * @since 1.0.0 */ +@SuppressWarnings("serial") public class XPathParseException extends XPathException { /** diff --git a/spring-xml/src/main/java/org/springframework/xml/xsd/SimpleXsdSchema.java b/spring-xml/src/main/java/org/springframework/xml/xsd/SimpleXsdSchema.java index 7db10881..93193db8 100644 --- a/spring-xml/src/main/java/org/springframework/xml/xsd/SimpleXsdSchema.java +++ b/spring-xml/src/main/java/org/springframework/xml/xsd/SimpleXsdSchema.java @@ -31,7 +31,6 @@ import org.xml.sax.SAXException; import org.springframework.beans.factory.InitializingBean; import org.springframework.core.io.Resource; import org.springframework.util.Assert; -import org.springframework.xml.namespace.QNameUtils; import org.springframework.xml.sax.SaxUtils; import org.springframework.xml.validation.XmlValidator; import org.springframework.xml.validation.XmlValidatorFactory; @@ -52,9 +51,9 @@ public class SimpleXsdSchema implements XsdSchema, InitializingBean { private static final String SCHEMA_NAMESPACE = "http://www.w3.org/2001/XMLSchema"; - private static final QName SCHEMA_NAME = QNameUtils.createQName(SCHEMA_NAMESPACE, "schema", "xsd"); + private static final QName SCHEMA_NAME = new QName(SCHEMA_NAMESPACE, "schema", "xsd"); - private Resource xsdResource; + private Resource xsdResource; private Element schemaElement; diff --git a/spring-xml/src/main/java/org/springframework/xml/xsd/XsdSchemaException.java b/spring-xml/src/main/java/org/springframework/xml/xsd/XsdSchemaException.java index af74c2e2..d6cd0b63 100644 --- a/spring-xml/src/main/java/org/springframework/xml/xsd/XsdSchemaException.java +++ b/spring-xml/src/main/java/org/springframework/xml/xsd/XsdSchemaException.java @@ -1,5 +1,5 @@ /* - * Copyright 2008 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ import org.springframework.xml.XmlException; * @author Arjen Poutsma * @since 1.5.0 */ +@SuppressWarnings("serial") public class XsdSchemaException extends XmlException { public XsdSchemaException(String message) { diff --git a/spring-xml/src/main/java/org/springframework/xml/xsd/commons/CommonsXsdSchemaException.java b/spring-xml/src/main/java/org/springframework/xml/xsd/commons/CommonsXsdSchemaException.java index ac491570..9b09e7ba 100644 --- a/spring-xml/src/main/java/org/springframework/xml/xsd/commons/CommonsXsdSchemaException.java +++ b/spring-xml/src/main/java/org/springframework/xml/xsd/commons/CommonsXsdSchemaException.java @@ -1,5 +1,5 @@ /* - * Copyright 2008 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import org.springframework.xml.xsd.XsdSchemaException; * @author Arjen Poutsma * @since 1.5.0 */ +@SuppressWarnings("serial") public class CommonsXsdSchemaException extends XsdSchemaException { public CommonsXsdSchemaException(String message) { diff --git a/spring-xml/src/test/java/org/springframework/xml/namespace/SimpleNamespaceContextTest.java b/spring-xml/src/test/java/org/springframework/xml/namespace/SimpleNamespaceContextTest.java index 521f35a1..2d19d34b 100644 --- a/spring-xml/src/test/java/org/springframework/xml/namespace/SimpleNamespaceContextTest.java +++ b/spring-xml/src/test/java/org/springframework/xml/namespace/SimpleNamespaceContextTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -91,10 +91,10 @@ public class SimpleNamespaceContextTest { Iterator iterator = context.getPrefixes("namespace"); Assert.assertNotNull("getPrefixes returns null", iterator); Assert.assertTrue("iterator is empty", iterator.hasNext()); - String result = (String) iterator.next(); + String result = iterator.next(); Assert.assertTrue("Invalid prefix", result.equals("prefix1") || result.equals("prefix2")); Assert.assertTrue("iterator is empty", iterator.hasNext()); - result = (String) iterator.next(); + result = iterator.next(); Assert.assertTrue("Invalid prefix", result.equals("prefix1") || result.equals("prefix2")); Assert.assertFalse("iterator contains more than two values", iterator.hasNext()); } @@ -103,7 +103,7 @@ public class SimpleNamespaceContextTest { Iterator iterator = context.getPrefixes(namespaceUri); Assert.assertNotNull("getPrefixes returns null", iterator); Assert.assertTrue("iterator is empty", iterator.hasNext()); - String result = (String) iterator.next(); + String result = iterator.next(); Assert.assertEquals("Invalid prefix", prefix, result); Assert.assertFalse("iterator contains multiple values", iterator.hasNext()); } @@ -113,7 +113,7 @@ public class SimpleNamespaceContextTest { Iterator iterator = context.getBoundPrefixes(); Assert.assertNotNull("getPrefixes returns null", iterator); Assert.assertTrue("iterator is empty", iterator.hasNext()); - String result = (String) iterator.next(); + String result = iterator.next(); Assert.assertEquals("Invalid prefix", "prefix", result); Assert.assertFalse("iterator contains multiple values", iterator.hasNext()); } @@ -171,10 +171,10 @@ public class SimpleNamespaceContextTest { Iterator iterator = context.getPrefixes(defaultNamespace); Assert.assertNotNull("getPrefixes returns null", iterator); Assert.assertTrue("iterator is empty", iterator.hasNext()); - String result = (String) iterator.next(); + String result = iterator.next(); Assert.assertTrue("Invalid prefix", result.equals(XMLConstants.DEFAULT_NS_PREFIX) || result.equals("prefix")); Assert.assertTrue("iterator is empty", iterator.hasNext()); - result = (String) iterator.next(); + result = iterator.next(); Assert.assertTrue("Invalid prefix", result.equals(XMLConstants.DEFAULT_NS_PREFIX) || result.equals("prefix")); Assert.assertFalse("iterator contains more than two values", iterator.hasNext()); }