Uploaded image for project: 'Commons Configuration'
  1. Commons Configuration
  2. CONFIGURATION-620

User Guide: Invalid Code Example

    XMLWordPrintableJSON

Details

    • Patch

    Description

      The first and third code examples on the File-based Configurations page (howto_filebased.xml) are invalid. Both example create a FileBasedConfigurationBuilder with a Type parameter of Configuration:

      FileBasedConfigurationBuilder<Configuration> builder =
          new FileBasedConfigurationBuilder<Configuration>(PropertiesConfiguration.class)
      . . .
      

      However, the Configuration Type parameter is not within bounds of the FileBasedConfigurationBuilder class since the parameter must extend FileBasedConfiguration:

      public class FileBasedConfigurationBuilder<T extends  FileBasedConfiguration> extends BasicConfigurationBuilder<T>
      

      Thus the examples need to be changed to:

      FileBasedConfigurationBuilder<FileBasedConfiguration> builder =
                  new FileBasedConfigurationBuilder<FileBasedConfiguration>(PropertiesConfiguration.class)
      . . .
      

      I will attach a patch with the necessary corrections.

      Attachments

        1. CONFIGURATION-620.patch
          1 kB
          Mark Vedder

        Activity

          People

            Unassigned Unassigned
            mvedder Mark Vedder
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: