velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cbris...@apache.org
Subject svn commit: r591900 - /velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/config/Data.java
Date Mon, 05 Nov 2007 07:37:20 GMT
Author: cbrisson
Date: Sun Nov  4 23:37:18 2007
New Revision: 591900

URL: http://svn.apache.org/viewvc?rev=591900&view=rev
Log:
always use en_US locale in config files

Modified:
    velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/config/Data.java

Modified: velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/config/Data.java
URL: http://svn.apache.org/viewvc/velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/config/Data.java?rev=591900&r1=591899&r2=591900&view=diff
==============================================================================
--- velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/config/Data.java (original)
+++ velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/config/Data.java Sun
Nov  4 23:37:18 2007
@@ -396,14 +396,17 @@
 
     protected static class NumberConverter implements Converter
     {
+
+        /* use english locale by default for numbers */
+        private static Locale configLocale = new Locale("en");
+        
         public Object convert(Class type, Object obj)
         {
             Number num = ConversionUtils.toNumber(obj);
             if (num == null)
             {
                 String value = String.valueOf(obj);
-                num = ConversionUtils.toNumber(value, "default",
-                                               Locale.getDefault());
+                num = ConversionUtils.toNumber(value, "default", configLocale);
                 if (num == null)
                 {
                     throw new IllegalArgumentException("Could not convert "+obj+" to a number");



Mime
View raw message