Wicket
  1. Wicket
  2. WICKET-1494

IntegerConvert cannot handle locale specific input/output

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.3
    • Fix Version/s: 1.3.5
    • Component/s: wicket
    • Labels:
      None

      Description

      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);"?

        Activity

        Matthew Young created issue -
        Johan Compagner made changes -
        Field Original Value New Value
        Fix Version/s 1.3.5 [ 12313175 ]
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Closed [ 6 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Matthew Young
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development