commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andre Weihe <>
Subject AW: [configuration] CombinedConfiguration#clone() not cloning changed properties
Date Fri, 14 Dec 2012 16:56:52 GMT
>-----Urspr√ľngliche Nachricht-----
>Von: Oliver Heger []
>Gesendet: Mittwoch, 5. Dezember 2012 21:52
>An: Commons Users List
>Betreff: Re: [configuration] CombinedConfiguration#clone() not cloning
>changed properties
>Am 05.12.2012 16:32, schrieb Andre Weihe:
>> CombinedConfiguration#clone() does not clone properties set/changed on
>the CombinedConfiguration that are stored in combinedRoot (which seems
>NOT to be cloned).
>> Bug, feature or "You are using it wrong!"?
>Probably a kind of missing feature...

Could this feature be added in an upcoming version?

>This seems to be the same problem as for updates of a
>CombinedConfiguration as described in the user's guide [1].
>When the CombinedConfiguration is cloned, its nodes structure is not
>cloned, but only the list of child configurations. (From these
>configurations the nodes tree is constructed again.) If changes were
>made which could not be assigned to one of the source configurations,
>they are lost.

The changes made on the CombinedConfiguration instance (which are possible since the interfaces
are present) are generally written to combinedRoot (even when matching keys are present in
(a) source configuration(s)), and are visible/accessible on/from that instance.
Just not on the cloned instance.

>I guess, a specific strategy has to be defined how to handle updates of
>a CombinedConfiguration in general. Currently, it is certainly not

I'd suggest also cloning combinedRoot, and/or applying the changes on the configuration with
the highest precedence, and/or stronger hints/advisories against using the mutators present
in the interface of CombinedConfiguration in the JavaDocs even including warning/error messages
during runtime (or compiletime?) when using the mutators present in the interface of CombinedConfiguration.

Best regards,

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message