commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Bourg <ebo...@micropole-univers.com>
Subject Re: [configuration] wrong test for CompositeConfiguration.subset ?
Date Thu, 04 Mar 2004 19:31:56 GMT
Jörg Schaible wrote:

> 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 ...

I tracked back the code to the version in Velocity, this was changed in 
the revision 1.14 of Configuration.java 3 years ago:

http://cvs.apache.org/viewcvs.cgi/jakarta-velocity/src/java/org/apache/velocity/runtime/configuration/Configuration.java?r1=1.13&r2=1.14&diff_format=h


It looks like a workaround to avoid an IndexOutOfBoundException if the 
key and the prefix have the same length on calling:

key.substring(prefix.length() + 1);

This feature is not documented in the javadoc and the subset produced is 
not useful. Even if it has been around for 3 years I think it's safe to 
assume nobody relies on this.

Emmanuel Bourg


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message