commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Bourg <>
Subject Re: [configuration] SubsetConfiguration
Date Fri, 05 Mar 2004 12:26:52 GMT
Jörg Schaible wrote:

> Looking at the changes for teh test cases, I have the impression that
> conf.setProperty("x.y.z", "1");
> subset = conf.subset("x.y.z.not_there");
> will also return an empty configuration, whereas this return value was previously always
just null.

Yes indeed, but since the subset is now synchronized with the parent 
configuration I think it's better to return an empty configuration, thus 
you can add new keys to the parent through a subset. For example :

Configuration config = new BaseConfiguration();
Configuration subset = config.subset("database");
subset.setProperty("driver", "oracle.jdbc.driver.OracleDriver");
subset.setProperty("url", "jdbc:oracle:thin:@host:1521:service");
subset.setProperty("username", "foo");
subset.setProperty("password", "bar");


Emmanuel Bourg

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

View raw message