Uploaded image for project: 'Commons BeanUtils'
  1. Commons BeanUtils
  2. BEANUTILS-79

BeanUtils.populate fails with DoubleLocaleConverter on integer values

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.6
    • None
    • None
    • None
    • Operating System: other
      Platform: Other

    • 21851

    Description

      BeanUtils.populate fails with "java.lang.IllegalArgumentException: argument type
      mismatch" when assigning strings containing integer values (like "123"), if they
      are converted through DoubleLocaleConverter, because DecimalFormater.parse()
      returns Long and not Double when possible.

      My fix is:

      DoubleLocaleConverter.java:

      protected Object parse(Object value, String pattern) throws ParseException

      { Number result = (Number) super.parse(value, pattern); return new Double(result.doubleValue()); }

      Attachments

        Activity

          People

            Unassigned Unassigned
            dpredovic@web.de Dejan Predovic
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: