cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r598726 - /incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/HttpHeaderHelper.java
Date Tue, 27 Nov 2007 18:20:48 GMT
Author: bimargulies
Date: Tue Nov 27 10:20:47 2007
New Revision: 598726

URL: http://svn.apache.org/viewvc?rev=598726&view=rev
Log:
Fix CXF-1227.

Modified:
    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/HttpHeaderHelper.java

Modified: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/HttpHeaderHelper.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/HttpHeaderHelper.java?rev=598726&r1=598725&r2=598726&view=diff
==============================================================================
--- incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/HttpHeaderHelper.java
(original)
+++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/HttpHeaderHelper.java
Tue Nov 27 10:20:47 2007
@@ -20,6 +20,8 @@
 package org.apache.cxf.helpers;
 
 import java.nio.charset.Charset;
+import java.nio.charset.IllegalCharsetNameException;
+import java.nio.charset.UnsupportedCharsetException;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -76,11 +78,13 @@
         if (newenc == null) {
             try {
                 newenc = Charset.forName(enc).name();
-            } catch (Exception ex) {
-                //ignore
+            } catch (IllegalCharsetNameException icne) {
+                return null;
+            } catch (UnsupportedCharsetException uce) {
+                return null;
             }
             encodings.put(enc, newenc);
         }
-        return newenc == null ? enc : newenc;
+        return newenc;
     }
 }



Mime
View raw message