cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject git commit: [CXF-5711] SOAP 1.2 fault reason xml:lang attribtue should follow XML standard
Date Tue, 29 Apr 2014 12:25:05 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes 379ff492b -> f2e293f87


[CXF-5711] SOAP 1.2 fault reason xml:lang attribtue should follow XML standard


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

Branch: refs/heads/2.7.x-fixes
Commit: f2e293f87eec8ba3eb12bdcaf67697e1176d716d
Parents: 379ff49
Author: Akitoshi Yoshida <ay@apache.org>
Authored: Tue Apr 29 12:36:56 2014 +0200
Committer: Akitoshi Yoshida <ay@apache.org>
Committed: Tue Apr 29 14:25:05 2014 +0200

----------------------------------------------------------------------
 .../main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java | 11 ++++++++++-
 .../cxf/jaxws/interceptors/WebFaultOutInterceptor.java   |  2 +-
 2 files changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/f2e293f8/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java
index 6c987c5..300c8bc 100644
--- a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java
+++ b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java
@@ -27,6 +27,7 @@ import java.net.HttpURLConnection;
 import java.util.Locale;
 import java.util.Map;
 import java.util.concurrent.Future;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import javax.xml.namespace.QName;
@@ -255,7 +256,15 @@ public class JaxWsClientProxy extends org.apache.cxf.frontend.ClientProxy
implem
     }
     
     private static Locale stringToLocale(String locale) {
-        String parts[] = locale.split("_", -1);
+        // use the IETF BCP 47 delimiter but accept the toString delimiter for cxf 2.7.x
+        final String ch;
+        if (locale.indexOf('_') > 0) {
+            LOG.log(Level.WARNING, "invalid IETF BCP 47 language tag: {0}", locale);
+            ch = "_";
+        } else {
+            ch = "-";
+        }
+        String parts[] = locale.split(ch, 0);
         if (parts.length == 1) {
             return new Locale(parts[0]);
         } else if (parts.length == 2) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/f2e293f8/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WebFaultOutInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WebFaultOutInterceptor.java
b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WebFaultOutInterceptor.java
index 2089b98..7b68d47 100644
--- a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WebFaultOutInterceptor.java
+++ b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WebFaultOutInterceptor.java
@@ -105,7 +105,7 @@ public class WebFaultOutInterceptor extends FaultOutInterceptor {
                     String convertedLang = lang.getLanguage();
                     String country = lang.getCountry();
                     if (country.length() > 0) {
-                        convertedLang = convertedLang + '_' + country;
+                        convertedLang = convertedLang + '-' + country;
                     }
                     f.setLang(convertedLang);
                 }


Mime
View raw message