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

Saving PropertiesConfiguration created with PropertiesConfiguration() constructor creates empty files

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.3
    • None
    • None
    • 1.3RC1

    Description

      The introduction of PropertiesConfigurationLayout broke the saving of in memory created PropertesConfiguration.

      This piece of code will yield empt saved file:
      PropertiesConfiguration pc = new PropertiesConfiguration();
      pc.addProperty("string", "value1");
      pc.save("testsave.properties");

      The problem is that no PropertiesConfigurationLayout is created and EVENT_ADD_PROPERTY is lost.
      Then when saving, an empty PropertiesConfigurationLayout is created and nothing is saved in output file.

      Added creation of PropertiesConfigurationLayout to PropertiesConfiguration() contructor, changed setLayout() to enforce that only one layout per PropertiesConfiguration must exist and added a testcase for this condition.

      Attachments

        1. ASF.LICENSE.NOT.GRANTED--layout.patch
          3 kB
          Gabriele Garuglieri

        Activity

          People

            Unassigned Unassigned
            garu Gabriele Garuglieri
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: