tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1140219 - /tomcat/trunk/java/org/apache/tomcat/util/buf/B2CConverter.java
Date Mon, 27 Jun 2011 16:01:32 GMT
Author: markt
Date: Mon Jun 27 16:01:32 2011
New Revision: 1140219

URL: http://svn.apache.org/viewvc?rev=1140219&view=rev
Log:
Simplify.
Covert aliases to lower case too.

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/buf/B2CConverter.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/buf/B2CConverter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/buf/B2CConverter.java?rev=1140219&r1=1140218&r2=1140219&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/buf/B2CConverter.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/buf/B2CConverter.java Mon Jun 27 16:01:32 2011
@@ -24,7 +24,6 @@ import java.io.InputStreamReader;
 import java.io.UnsupportedEncodingException;
 import java.nio.charset.Charset;
 import java.util.Locale;
-import java.util.Map.Entry;
 import java.util.concurrent.ConcurrentHashMap;
 
 import org.apache.tomcat.util.res.StringManager;
@@ -53,12 +52,12 @@ public class B2CConverter {
         new ConcurrentHashMap<String, Charset>();
 
     static {
-        for (Entry<String,Charset> entry :
-                Charset.availableCharsets().entrySet()) {
-            Charset charset = entry.getValue(); 
-            encodingToCharsetCache.put(entry.getKey().toLowerCase(), charset);
+        for (Charset charset: Charset.availableCharsets().values()) {
+            encodingToCharsetCache.put(
+                    charset.name().toLowerCase(Locale.US), charset);
             for (String alias : charset.aliases()) {
-                encodingToCharsetCache.put(alias, charset);
+                encodingToCharsetCache.put(
+                        alias.toLowerCase(Locale.US), charset);
             }
         }
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message