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

XMLConfiguration.subset() with FileChangedReloadingStrategy does *not* 'see' file changes

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: 1.4
    • Component/s: None
    • Labels:
      None

      Description

      XMLConfiguration.subset() with FileChangedReloadingStrategy does not 'see' file changes

      Configuration.xml:
      <conf>
      <parent-item>
      <sub-item>old_value</sub-item>
      </parent-item>
      </conf>

      1. XMLConfiguration is loaded:
      config = new XMLConfiguration("c:
      conf.xml");
      config.setReloadingStrategy(new FileChangedReloadingStrategy());

      2. Now, <sub-item> node value changes to "new_value",
      and the code:
      Configuration parentItemConfig = config.subset("parent-item"); [AA]
      String ss2 = parentItemConfig.getString("sub-item");
      returns "old_value" !!!

      while: config.getString("parent-item.sub-item"); returns new refreshed value.

      It is a bug, we have FileChangedReloadingStrategy, we create new subset in [AA] but receive old values.

      [for now, workaround for config users is to call config.reload() when strategy.hasChanged()]

        Attachments

          Activity

            People

            • Assignee:
              oheger Oliver Heger
              Reporter:
              januszst Janusz Studzizba
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: