commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Schaible <>
Subject RE: [configuration] wrong test for CompositeConfiguration.subset ?
Date Thu, 04 Mar 2004 19:00:12 GMT
Emmanuel Bourg wrote on Thursday, March 04, 2004 7:56 PM:

> I'm reviewing the subset code and found a confusing test case for
> CompositeConfiguration: 
> subset = cc.subset("test.short");
> assertEquals("1", subset.getString("test.short"));
> Is this right ? The "test.short" prefix should be removed
> from the keys
> in the subset, and unless the key "test.short.test.short"
> exists in the
> parent configuration, no value should be associated to the
> "test.short" key in the subset and the assertion should fail.
> I think the right test is:
> subset = cc.subset("test");
> assertEquals("1", subset.getString("short"));

Well, there is a special comment in the subset implementation for this case.
It was obviously intented that if subset pattern == key a subset with this single key is delivered.
But I cannot tell you why it was originally implemented in this way and what we would break
changing the behaviour for this case ...


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

View raw message