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

Blank lines before always 0 for first property despite header comment

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.7
    • 2.8.0
    • Format
    • None

    Description

      Given a properties file like the one described in PropertiesConfigurationLayout:

      demo.properties
       # A demo configuration file
       # for Demo App 1.42
      
       # Application name
       AppName=Demo App
      
       # Application vendor
       AppVendor=DemoSoft
      
      
       # GUI properties
       # Window Color
       windowColors=0xFFFFFF,0x000000
      
       # Include some setting
       include=settings.properties
       # Another vendor
       AppVendor=TestSoft
      

      The documentation states

      For the property AppName one comment line and one leading blanc line is stored.

      But the format actually thinks there is no leading blank line for AppName :

      final PropertiesConfiguration properties = new Configurations().properties(new File("demo.properties"));
      
      final int blankLinesBefore = properties.getLayout().getBlancLinesBefore("AppName");
      assert blankLinesBefore == 1 : "Blank lines before for first property not correct";
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              daniel@peger.de Daniel H. Peger
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: