openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From allee8...@apache.org
Subject svn commit: r698813 - in /openjpa/trunk: openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java
Date Thu, 25 Sep 2008 04:45:49 GMT
Author: allee8285
Date: Wed Sep 24 21:45:48 2008
New Revision: 698813

URL: http://svn.apache.org/viewvc?rev=698813&view=rev
Log:
OPENJPA-719 - Ensure English locale is used in toUpperCase/toLowerCase for locale insensitive
code.

Modified:
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java?rev=698813&r1=698812&r2=698813&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java
Wed Sep 24 21:45:48 2008
@@ -41,6 +41,7 @@
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 import java.util.Set;
 
@@ -2566,7 +2567,7 @@
         // or 'Object'; figure out what type to use
         String typeName = type.getName();
         if (type.isPrimitive())
-            typeName = typeName.substring(0, 1).toUpperCase()
+            typeName = typeName.substring(0, 1).toUpperCase(Locale.ENGLISH)
                 + typeName.substring(1);
         else if (type.equals(String.class))
             typeName = "String";
@@ -3971,7 +3972,7 @@
         String methName;
         if (type.isPrimitive()) {
             methName = type.getName();
-            methName = Character.toUpperCase(methName.charAt(0))
+            methName = methName.substring(0, 1).toUpperCase(Locale.ENGLISH)
                 + methName.substring(1);
             methName = "read" + methName;
         } else
@@ -4128,7 +4129,7 @@
         String methName;
         if (type.isPrimitive()) {
             methName = type.getName();
-            methName = Character.toUpperCase(methName.charAt(0))
+            methName = methName.substring(0, 1).toUpperCase(Locale.ENGLISH)
                 + methName.substring(1);
             methName = "write" + methName;
         } else

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java?rev=698813&r1=698812&r2=698813&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java
(original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java
Wed Sep 24 21:45:48 2008
@@ -241,7 +241,7 @@
      * Returns a symbolic constant for the specified string level.
      */
     public static short getLevel(String str) {
-        str = str.toUpperCase().trim();
+        str = str.toUpperCase(Locale.ENGLISH).trim();
         short val = TRACE_STR.equals(str) ? Log.TRACE :
             INFO_STR.equals(str) ? Log.INFO :
                 WARN_STR.equals(str) ? Log.WARN :



Mime
View raw message