Commits

unkyaku  committed 7d60b04

Roll back locale sensitive Number -> String conversion.

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@334e221344d-f017-0410-9bd5-d282ab1896d7

  • Participants
  • Parent commits 615e3f1

Comments (0)

Files changed (2)

File src/java/com/opensymphony/xwork/util/XWorkBasicConverter.java

             result = df.format(value);
         } else if (value instanceof String[]) {
             result = TextUtils.join(", ", (String[]) value);
-        } else if (Number.class.isAssignableFrom(value.getClass())) {
-            NumberFormat numFormat = NumberFormat.getInstance(getLocale(context));
-            result = numFormat.format(value);
         }
 
         return result;

File src/test/com/opensymphony/xwork/util/XWorkConverterTest.java

         assertEquals(dateString, converter.convertValue(context, null, null, null, date, String.class));
     }
 
-    public void testPrimitiveToString() {
-        Locale locale = Locale.GERMANY;
-        NumberFormat nf = NumberFormat.getInstance(locale);
-        context.put(ActionContext.LOCALE, locale);
-
-        String origValue = "123456789";
-        Long longValue = new Long(origValue);
-        String formattedValue = nf.format(new Long(origValue));
-        assertEquals(formattedValue, converter.convertValue(context, null, null, null, new Long(origValue), String.class));
-        assertEquals(longValue, converter.convertValue(context, null, null, null, formattedValue, Long.class));
-        assertEquals(longValue, converter.convertValue(context, null, null, null, origValue, Long.class));
-
-        origValue = "123456.789";
-
-        Float floatValue = new Float(origValue);
-        formattedValue = nf.format(new Float(origValue));
-        assertEquals(formattedValue, converter.convertValue(context, null, null, null, new Float(origValue), String.class));
-        assertEquals(floatValue, converter.convertValue(context, null, null, null, formattedValue, Float.class));
-    }
-
     public void testStringArrayToCollection() {
         List list = new ArrayList();
         list.add("foo");