commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Heger <oliver.he...@oliver-heger.de>
Subject Re: [configuration] PropertiesConfiguration 1.2: infinite loop in property interpolation -- Bug?
Date Fri, 21 Jul 2006 17:33:45 GMT
beat.hess@ubs.com wrote:
> suppose the property
> 
> == PROPERTY FILE STARTS
> test = ${a}${a}${a}
> == PROPERTY FILE ENDS
> 
> where ${a} is not defined.
> 
> If I'm using PropertiesConfiguration.getString("test"), the exception 
> "unhandled exception: infinite loop in property interpolation of
> ${a}${a}${a}: a->a"
> is thrown.
> 
> In my application, ${a} is undefined in the first servlet call, but
> defined
> in the second call.
> 
> As a work around, I had to introduce some helper variables:
> 
> == PROPERTY FILE STARTS
> a1 = ${a}
> a2 = ${a}
> a3 = ${a}
> test = ${a1}${a2}${a3}
> == PROPERTY FILE ENDS
> 
> Would be nice, if this could be fixed some time.
> 
> Cheers, Beat
> 

Beat,

thanks for spotting this.

In [Commons Lang] there is a class VariableFormatter, which deals with 
similar variable substitution stuff, but was not released yet. This 
class is more powerful and should be able to handle your situation. When 
this class gets released I plan to use it for [configuration]'s 
interpolation mechanism. So this problem should be solved then.

Oliver

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


Mime
View raw message