Mark Vedder created CONFIGURATION-620:
-----------------------------------------

             Summary: User Guide: Invalid Code Example
                 Key: CONFIGURATION-620
                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-620
             Project: Commons Configuration
          Issue Type: Bug
          Components: Documentation
    Affects Versions: 2.0-beta2
            Reporter: Mark Vedder
            Priority: Minor


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}}:

{code:java}
FileBasedConfigurationBuilder<Configuration> builder =
    new 
FileBasedConfigurationBuilder<Configuration>(PropertiesConfiguration.class)
. . .
{code}

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

{code:java}
public class FileBasedConfigurationBuilder<T extends  FileBasedConfiguration> 
extends BasicConfigurationBuilder<T>
{code}

Thus the examples need to be changed to:

{code:java}
FileBasedConfigurationBuilder<FileBasedConfiguration> builder =
            new 
FileBasedConfigurationBuilder<FileBasedConfiguration>(PropertiesConfiguration.class)
. . .
{code}

I will attach a patch with the necessary corrections.




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to