cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject cxf git commit: [CXF-6665] ClassCastException in SoapActionInInterceptor (regression in 2.7.x)
Date Thu, 05 Nov 2015 17:36:18 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes 86b169b16 -> 39e65abf8


[CXF-6665] ClassCastException in SoapActionInInterceptor (regression in 2.7.x)


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/39e65abf
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/39e65abf
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/39e65abf

Branch: refs/heads/2.7.x-fixes
Commit: 39e65abf8fe2b181a9262c5953c389e9bb7ca706
Parents: 86b169b
Author: Akitoshi Yoshida <ay@apache.org>
Authored: Thu Nov 5 18:35:02 2015 +0100
Committer: Akitoshi Yoshida <ay@apache.org>
Committed: Thu Nov 5 18:35:02 2015 +0100

----------------------------------------------------------------------
 .../binding/soap/interceptor/SoapActionInInterceptor.java   | 9 +++++----
 .../soap/interceptor/SoapActionInInterceptorTest.java       | 5 ++---
 2 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/39e65abf/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInInterceptor.java
b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInInterceptor.java
index f079681..2fba894 100644
--- a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInInterceptor.java
+++ b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInInterceptor.java
@@ -83,10 +83,11 @@ public class SoapActionInInterceptor extends AbstractSoapInterceptor {
             if (start == -1 && ct.indexOf("multipart/related") == 0 && ct.indexOf("start-info")
== -1) {
                 // the action property may not be found at the package's content-type for
non-mtom multipart message
                 // but skip searching if the start-info property is set
-                List<String> cts = CastUtils.cast((List<?>)(((Map<?, ?>)
-                    message.get("javax.mail.internet.InternetHeaders")).get(Message.CONTENT_TYPE)));
-                if (cts != null && cts.size() > 0) {
-                    ct = cts.get(0);
+                // use cxf-2.7.x specific code
+                String[] cts = ((javax.mail.internet.InternetHeaders)
+                    message.get("javax.mail.internet.InternetHeaders")).getHeader(Message.CONTENT_TYPE);
+                if (cts != null && cts.length > 0) {
+                    ct = cts[0];
                     start = ct.indexOf("action=");
                 }
             }

http://git-wip-us.apache.org/repos/asf/cxf/blob/39e65abf/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapActionInInterceptorTest.java
----------------------------------------------------------------------
diff --git a/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapActionInInterceptorTest.java
b/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapActionInInterceptorTest.java
index 286b28b..e39284a 100644
--- a/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapActionInInterceptorTest.java
+++ b/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapActionInInterceptorTest.java
@@ -173,12 +173,11 @@ public class SoapActionInInterceptorTest extends Assert {
     private SoapMessage setUpMessage(String contentType, SoapVersion version, String prop)
{
         SoapMessage message = control.createMock(SoapMessage.class);
         Map<String, List<String>> headers = new TreeMap<String, List<String>>(String.CASE_INSENSITIVE_ORDER);
-        Map<String, List<String>> partHeaders = new TreeMap<String, List<String>>(String.CASE_INSENSITIVE_ORDER);
+        javax.mail.internet.InternetHeaders partHeaders = new javax.mail.internet.InternetHeaders();
         if (version instanceof Soap11 && prop != null) {
             headers.put("SOAPAction", Collections.singletonList(prop));
         } else if (version instanceof Soap12 && prop != null) {
-            partHeaders.put(Message.CONTENT_TYPE, 
-                            Collections.singletonList("application/soap+xml; action=\"" +
prop + "\""));
+            partHeaders.setHeader(Message.CONTENT_TYPE, "application/soap+xml; action=\""
+ prop + "\"");
         }
         EasyMock.expect(message.getVersion()).andReturn(version).anyTimes();
         EasyMock.expect(message.get(Message.CONTENT_TYPE)).andReturn(contentType).anyTimes();


Mime
View raw message