commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wspe...@apache.org
Subject svn commit: r1205497 - in /commons/proper/dbutils/trunk/src: changes/changes.xml main/java/org/apache/commons/dbutils/BasicRowProcessor.java
Date Wed, 23 Nov 2011 17:17:56 GMT
Author: wspeirs
Date: Wed Nov 23 17:17:55 2011
New Revision: 1205497

URL: http://svn.apache.org/viewvc?rev=1205497&view=rev
Log:
- Changed toLowerCase calls to use a default locale of Locale.ENGLISH
DBUTILS-73

Modified:
    commons/proper/dbutils/trunk/src/changes/changes.xml
    commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils/BasicRowProcessor.java

Modified: commons/proper/dbutils/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/changes/changes.xml?rev=1205497&r1=1205496&r2=1205497&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/changes/changes.xml (original)
+++ commons/proper/dbutils/trunk/src/changes/changes.xml Wed Nov 23 17:17:55 2011
@@ -42,6 +42,9 @@ The <action> type attribute can be add,u
       <action dev="wspeirs" type="update" issue="DBUTILS-77">
         Updated documentation to better reflect the use of pmdKnownBroken
       </action>
+      <action due-to="Sebb" type="fix" issue="DBUTILS-73">
+        Added a fixed Locale (Locale.ENGLISH) to all toLowerCase calls in BasicRowProcessor
+      </action>
       <action due-to="Michael Osipov" type="add" issue="DBUTILS-67">
         Added BeanMapHandler
       </action>

Modified: commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils/BasicRowProcessor.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils/BasicRowProcessor.java?rev=1205497&r1=1205496&r2=1205497&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils/BasicRowProcessor.java
(original)
+++ commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils/BasicRowProcessor.java
Wed Nov 23 17:17:55 2011
@@ -21,6 +21,7 @@ import java.sql.ResultSetMetaData;
 import java.sql.SQLException;
 import java.util.HashMap;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 
 /**
@@ -199,7 +200,7 @@ public class BasicRowProcessor implement
         /** {@inheritDoc} */
         @Override
         public boolean containsKey(Object key) {
-            Object realKey = lowerCaseMap.get(key.toString().toLowerCase());
+            Object realKey = lowerCaseMap.get(key.toString().toLowerCase(Locale.ENGLISH));
             return super.containsKey(realKey);
             // Possible optimisation here:
             // Since the lowerCaseMap contains a mapping for all the keys,
@@ -210,7 +211,7 @@ public class BasicRowProcessor implement
         /** {@inheritDoc} */
         @Override
         public Object get(Object key) {
-            Object realKey = lowerCaseMap.get(key.toString().toLowerCase());
+            Object realKey = lowerCaseMap.get(key.toString().toLowerCase(Locale.ENGLISH));
             return super.get(realKey);
         }
 
@@ -224,7 +225,7 @@ public class BasicRowProcessor implement
              * (That's why we call super.remove(oldKey) and not just
              * super.put(key, value))
              */
-            Object oldKey = lowerCaseMap.put(key.toLowerCase(), key);
+            Object oldKey = lowerCaseMap.put(key.toLowerCase(Locale.ENGLISH), key);
             Object oldValue = super.remove(oldKey);
             super.put(key, value);
             return oldValue;
@@ -243,7 +244,7 @@ public class BasicRowProcessor implement
         /** {@inheritDoc} */
         @Override
         public Object remove(Object key) {
-            Object realKey = lowerCaseMap.remove(key.toString().toLowerCase());
+            Object realKey = lowerCaseMap.remove(key.toString().toLowerCase(Locale.ENGLISH));
             return super.remove(realKey);
         }
     }



Mime
View raw message