Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 58832 invoked from network); 21 Jul 2006 17:34:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Jul 2006 17:34:18 -0000 Received: (qmail 99600 invoked by uid 500); 21 Jul 2006 17:34:12 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 99531 invoked by uid 500); 21 Jul 2006 17:34:12 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 99520 invoked by uid 99); 21 Jul 2006 17:34:12 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Jul 2006 10:34:12 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [212.227.126.177] (HELO moutng.kundenserver.de) (212.227.126.177) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Jul 2006 10:34:11 -0700 Received: from [217.81.219.181] (helo=[192.168.178.21]) by mrelayeu.kundenserver.de (node=mrelayeu6) with ESMTP (Nemesis), id 0ML29c-1G3ysm1Tjt-0005dF; Fri, 21 Jul 2006 19:33:48 +0200 Message-ID: <44C10FF9.8010708@oliver-heger.de> Date: Fri, 21 Jul 2006 19:33:45 +0200 From: Oliver Heger User-Agent: Thunderbird 1.5.0.4 (Windows/20060516) MIME-Version: 1.0 To: Jakarta Commons Users List Subject: Re: [configuration] PropertiesConfiguration 1.2: infinite loop in property interpolation -- Bug? References: <512D8032B0DA7E4F8B06BD3F33C4F3FE32CD56@S01B1F4N.rzud.urdorf.ubs.ch> In-Reply-To: <512D8032B0DA7E4F8B06BD3F33C4F3FE32CD56@S01B1F4N.rzud.urdorf.ubs.ch> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: kundenserver.de abuse@kundenserver.de login:060b6f3a5b4852d7db894881f1c69c62 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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