ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeffrey Bacon <>
Subject Re: recursive expansion of property names
Date Fri, 25 Jun 2004 19:52:06 GMT
good call.  I'll bet that's exactly what's happening.  Maybe what it 
should do is create a tree out of the string and then walk the tree in a 
depth-first manner to do a replacement on each node where each node is 
composed of the combination of it's child nodes.
Jeffrey Bacon
Creative Developer

Wascally Wabbit wrote:
> At 02:00 PM 6/25/2004, you wrote:
>  >can you copy-n-paste your resolvePropertiesRecursively method here?  I am
>  >getting a wierd error.  I'll trace it through below.  It's wired that it
>  >suddenly craps out not finding the 3rd '${' instance (or the 4th instance
>  >for that matter).
> I think there are problems with the resolvePropertiesRecursivlly method. In
> particular
> these two lines look funny to me (haven't debugged thoroughly):
> ?? sb.replace(nextOpenerIndex, balancingCloserIndex +
> RecursivePropertyParser.CLOSER_LENGTH, fragment);
> ?? nextOpenerIndex = RecursivePropertyParser.nextOpener(sb.toString(),
> balancingCloserIndex + 1);
> The first calc of 'balancingCloserIndex' (not shown) is determined based
> on the original string, but the increment code is based on the
> string-under-construction. There's no guarantee that the
> 'balancingCloserIndex' index is even remotely correct for the partially
> constructed string. The closer index value should be adjusted
> for the difference between the property's name length and the replacing
> property value's length. It's not.
> Example: if the original string is "${foo}/${${bar}.src}" and "foo" is 
> defined
> as "fu" then 'balancingCloserIndex' would be initially set for the 5th
> index which would be *WRONG* for the partially constructed buffer of
> "fu/${${bar}.src}" as passed to the nextOpener method...the next call to
> nextOpener would completely miss the next two $ openers.
> The Wabbit
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message