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

PropertiesConfigurationLayout broke the autoSave behaviour of PropertiesConfiguration

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3
    • Component/s: None
    • Labels:
      None
    • Environment:

      1.3RC1

      Description

      When using PropertiesConfiguration with autoSave "true" the PropertiesConfigurationLayout causes invalid properties files to be saved.

      When using addProperty("key", "value"); where key does not exist yet in the configuration the EVENT_ADD_PROPERTY event that updates the PropertiesConfigurationLayout with the new "key" is issued only after the possiblySave() method is invoked so the new property will not be saved.

      When using setProperty("key", "value"); where key does not exist yet in the configuration the EVENT_SET_PROPERTY event that updates the PropertiesConfigurationLayout with the new "key" is issued only after the possiblySave() method is invoked so the new property will not be saved.

      The way it is implemented now makes content of the saved file depending on PropertiesConfigurationLayout content that depends on an event that will be issued only after the file was properly updated. This creates a circular dependency that cannot work.

        Attachments

        1. 223-test.patch
          7 kB
          Gabriele Garuglieri

          Activity

            People

            • Assignee:
              oheger Oliver Heger
              Reporter:
              garu Gabriele Garuglieri
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: