Commons Configuration
  1. Commons Configuration
  2. CONFIGURATION-315

CombinedConfiguration fire EVENT_COMBINED_INVALIDATE even before the contained configuration is updated

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5
    • Fix Version/s: 1.6
    • Component/s: Events & Notifications
    • Labels:
      None
    • Environment:

      Any

      Description

      CombinedConfiguration.configurationChanged doesn't check the !event.isBeforeUpdate() and trigger the invalidate call. The invalidate call fire the EVENT_COMBINED_INVALIDATE. so now when a contained config is changed, EVENT_COMBINED_INVALIDATE is fired twice by the CombinedConfiguration. However it should only fire it after the contained FileConfiguration is updated.

        Activity

        Hide
        Andy Yeung added a comment -

        I also found that the missing checking of isBeforeUpdate in CombinedConfiguration.configurationChanged sometimes mess up the detailEvents in XMLConfiguration contained in CombinedConfiguration. This would prevent !isBeforeUpdate event to sent out to CombinedConfiguration listener, when XMLConfiguration receive the event from its delegate in some cases. (this cases not always occur but happen occasionally). The detailEvents is -1 in that cases.

        Show
        Andy Yeung added a comment - I also found that the missing checking of isBeforeUpdate in CombinedConfiguration.configurationChanged sometimes mess up the detailEvents in XMLConfiguration contained in CombinedConfiguration. This would prevent !isBeforeUpdate event to sent out to CombinedConfiguration listener, when XMLConfiguration receive the event from its delegate in some cases. (this cases not always occur but happen occasionally). The detailEvents is -1 in that cases.
        Hide
        Oliver Heger added a comment -

        You are right: sending two events per change is an inconsistent behavior.

        I have applied a fix. The isBeforeUpdate() property of the change event is now taken into account.

        Thanks.

        Show
        Oliver Heger added a comment - You are right: sending two events per change is an inconsistent behavior. I have applied a fix. The isBeforeUpdate() property of the change event is now taken into account. Thanks.

          People

          • Assignee:
            Oliver Heger
            Reporter:
            Andy Yeung
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development