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

[beanutils] DecimalLocaleConverter und subClasses: ConversionException not thrown

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.8.0
    • None
    • None
    • Operating System: Mac OS X 10.3
      Platform: Macintosh

    • 33839

    Description

      To simulate the error run the TestCase
      org.apache.commons.beanutils.locale.LocalConvertUtilsTestCase.fixmetestNegativeScalar.

      The DecimalLocaleConverter has an error in constructor chaining.
      The following constructor
      >>>
      public DecimalLocaleConverter(Locale locale, String pattern, boolean locPattern)

      { this(null, locale, pattern, locPattern); }

      <<<
      calls the constructor
      >>>
      public DecimalLocaleConverter(Object defaultValue, Locale locale, String pattern, boolean
      locPattern)

      { super(defaultValue, locale, pattern, locPattern); }

      <<<
      which always returns a default value.
      The constructor has to call anlogous to DateLocalConverter
      >>>
      public DecimalLocaleConverter(Locale locale, String pattern, boolean locPattern)

      { super(locale, pattern, locPattern); }

      <<<

      By the way: I missing a CalendarLocalConverter as a subclass of DateLocaleConverter!

      Thanks,

      Stefan Lötscher, Inventage

      Attachments

        Activity

          People

            Unassigned Unassigned
            sloetscher@inventage.com Stefan Lötscher
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: