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

Blank lines before always 0 for first property despite header comment

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          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:

              Slack

                Issue deployment