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

LocaleConvertUtilsBean.convert throws NPE on null Locale when debug logging is enabled

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.7.0, 1.8.0-BETA
    • 1.8.0
    • None

    Description

      LocaleConvertUtilsBean.convert(String value, Class clazz, Locale locale, String pattern) generally works with a null Locale argument, as the lookup(Locale locale) method checks whether the argument is null and uses the default locale in that case.

      However, if debug logging is enabled for LocaleConvertUtils, the method throws NullPointerException on null locale because the debug message does locale.toString().

      The same thing happens with the convert(String values[], Class clazz, Locale locale, String pattern) method.

      Attachments

        Activity

          People

            niallp Niall Pemberton
            lucianc Lucian Chirita
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: