This is an automated email from the ASF dual-hosted git repository.

dkulp pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 464b614120156f7eca6c06cd29d4c73251834442
Author: Daniel Kulp <dk...@apache.org>
AuthorDate: Mon Jun 11 16:17:56 2018 -0400

    Fix a bunch of compiler warnings
---
 .../java/org/apache/cxf/endpoint/ClientImpl.java   |  2 ++
 .../java/org/apache/cxf/jaxws/JaxWsClientTest.java |  7 +++++--
 .../policyhandlers/AbstractStaxBindingHandler.java | 22 +++++++++++-----------
 3 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java 
b/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
index eb82b88..2a73a84 100644
--- a/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
+++ b/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
@@ -1145,6 +1145,8 @@ public class ClientImpl
 
     
     public class IllegalEmptyResponseException extends IllegalStateException {
+        private static final long serialVersionUID = 1L;
+
         public IllegalEmptyResponseException() {
             super();
         }
diff --git 
a/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java 
b/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java
index 62bc3ce..fa46e26 100644
--- a/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java
+++ b/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java
@@ -45,6 +45,7 @@ import javax.xml.ws.handler.soap.SOAPMessageContext;
 import org.apache.cxf.endpoint.Client;
 import org.apache.cxf.endpoint.ClientImpl;
 import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.jaxws.support.JaxWsEndpointImpl;
 import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
@@ -338,6 +339,7 @@ public class JaxWsClientTest extends AbstractJaxWsTest {
         Greeter greeter = s.getPort(portName, Greeter.class);
         d.setMessageObserver(new MessageReplayObserver("sayHiResponse.xml"));
 
+        @SuppressWarnings("rawtypes") // JAX-WS api doesn't specify this as 
List<Handler<? extends MessageContext>>
         List<Handler> chain = 
((BindingProvider)greeter).getBinding().getHandlerChain();
         chain.add(new LogicalHandler<LogicalMessageContext>() {
             public void close(MessageContext arg0) {
@@ -351,7 +353,7 @@ public class JaxWsClientTest extends AbstractJaxWsTest {
 
                 Boolean outbound = (Boolean) 
context.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
                 if (outbound) {
-                    headers = (Map<String, List<String>>) 
context.get(MessageContext.HTTP_REQUEST_HEADERS);
+                    headers = CastUtils.cast((Map<?, ?>) 
context.get(MessageContext.HTTP_REQUEST_HEADERS));
                     if (headers == null) {
                         headers = new HashMap<String, List<String>>();
                         context.put(MessageContext.HTTP_REQUEST_HEADERS, 
headers);
@@ -377,6 +379,7 @@ public class JaxWsClientTest extends AbstractJaxWsTest {
         Greeter greeter = s.getPort(portName, Greeter.class);
         d.setMessageObserver(new MessageReplayObserver("sayHiResponse.xml"));
 
+        @SuppressWarnings("rawtypes")
         List<Handler> chain = 
((BindingProvider)greeter).getBinding().getHandlerChain();
         chain.add(new SOAPHandler<SOAPMessageContext>() {
 
@@ -384,7 +387,7 @@ public class JaxWsClientTest extends AbstractJaxWsTest {
 
                     Boolean outbound = (Boolean) 
context.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
                     if (outbound) {
-                        headers = (Map<String, List<String>>) 
context.get(MessageContext.HTTP_REQUEST_HEADERS);
+                        headers = CastUtils.cast((Map<?, ?>) 
context.get(MessageContext.HTTP_REQUEST_HEADERS));
                         if (headers == null) {
                             headers = new HashMap<String, List<String>>();
                             context.put(MessageContext.HTTP_REQUEST_HEADERS, 
headers);
diff --git 
a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractStaxBindingHandler.java
 
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractStaxBindingHandler.java
index 0860627..4dc5658 100644
--- 
a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractStaxBindingHandler.java
+++ 
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractStaxBindingHandler.java
@@ -514,18 +514,18 @@ public abstract class AbstractStaxBindingHandler extends 
AbstractCommonBindingHa
         properties.setSignatureKeyIdentifier(getKeyIdentifierType(token));
 
         // Find out do we also need to include the token as per the Inclusion 
requirement
-        WSSecurityTokenConstants.KeyIdentifier keyIdentifier = 
properties.getSignatureKeyIdentifier();
-        if (token instanceof X509Token
-            && isTokenRequired(token.getIncludeTokenType())
-            && 
(WSSecurityTokenConstants.KeyIdentifier_IssuerSerial.equals(keyIdentifier)
-                || 
WSSecurityTokenConstants.KEYIDENTIFIER_THUMBPRINT_IDENTIFIER.equals(keyIdentifier)
-                || 
WSSecurityTokenConstants.KEYIDENTIFIER_SECURITY_TOKEN_DIRECT_REFERENCE.equals(
-                    keyIdentifier))) {
-            properties.setIncludeSignatureToken(true);
-        } else {
-            properties.setIncludeSignatureToken(false);
+        properties.setIncludeSignatureToken(false);
+        for (SecurityTokenConstants.KeyIdentifier keyIdentifier : 
properties.getSignatureKeyIdentifiers()) {
+            if (token instanceof X509Token
+                && isTokenRequired(token.getIncludeTokenType())
+                && 
(WSSecurityTokenConstants.KeyIdentifier_IssuerSerial.equals(keyIdentifier)
+                    || 
WSSecurityTokenConstants.KEYIDENTIFIER_THUMBPRINT_IDENTIFIER.equals(keyIdentifier)
+                    || 
WSSecurityTokenConstants.KEYIDENTIFIER_SECURITY_TOKEN_DIRECT_REFERENCE.equals(
+                        keyIdentifier))) {
+                properties.setIncludeSignatureToken(true);
+            }
         }
-
+        
         String userNameKey = SecurityConstants.SIGNATURE_USERNAME;
         if (binding instanceof SymmetricBinding) {
             userNameKey = SecurityConstants.ENCRYPT_USERNAME;

-- 
To stop receiving notification emails like this one, please contact
dk...@apache.org.

Reply via email to