IntegerConvert cannot handle locale specific input/output
---------------------------------------------------------

                 Key: WICKET-1494
                 URL: https://issues.apache.org/jira/browse/WICKET-1494
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.3.3
            Reporter: Matthew Young


IntegerConverter, and possibly anything extends AbstractIntegerConverter cannot 
parse locale formatted input or output locale formatted string.  E.g., 
IntegerConverter.convertToObject("999,999",  new Locale("us")) raise 
parseexception.  IntegerConverter.convertToString(new Integer("999999", new 
Locale("us"))  => "999999" instead of "999,999".

This is because in AbstractIntegerConverter:

        public NumberFormat getNumberFormat(Locale locale)
        {
                NumberFormat numberFormat = 
(NumberFormat)numberFormats.get(locale);
                if (numberFormat == null)
                {
                        numberFormat = NumberFormat.getIntegerInstance(locale);
                        numberFormat.setParseIntegerOnly(true);
                        numberFormat.setGroupingUsed(false);     
<<<<<<<<<<<<<<<<<<<<<<<<<<  this is the problem
                        numberFormats.put(locale, numberFormat);
                }
                return (NumberFormat)numberFormat.clone();
        }

Is it possible to remove "numberFormat.setGroupingUsed(false);"?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to