Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-7164

ConfigurationSource#getProperty(propertyName, defaultValue) throws NullPointerException when defaultValue is null

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 3.5-milestone-1
    • 3.3-milestone-1
    • Configuration
    • None
    • Unit
    • Easy

    Description

      The reason is that CommonsConfigurationSource calls devaultValue.getClass() which fails when defaultValue is null. Stacktrace:

      Caused by: java.lang.NullPointerException
        at org.xwiki.configuration.internal.CommonsConfigurationSource.getProperty(CommonsConfigurationSource.java:60)
        at org.xwiki.configuration.internal.CompositeConfigurationSource.getProperty(CompositeConfigurationSource.java:117)
      

      The javadoc of ConfigurationSource#getProperty(propertyName, defaultValue) doesn't specify that the defaultValue must not be null. We should either fix the javadoc or the implementation.

      Attachments

        Issue Links

          Activity

            People

              tmortagne Thomas Mortagne
              mflorea Marius Dumitru Florea
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: