ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Alberto Fernandez" <>
Subject RE: Possible Ant 1.7 alpha bug: property expansion.
Date Thu, 03 Jun 2004 17:56:01 GMT
> From: Matt Benson [] 
> ....
> I think you're basically right.  And I remember having
> wondered why java.text.Format was implemented that
> way; now I know...
> > Such strategy would allow writing property
> > evaluators that contain real
> > complex expressions inside. Which we have discussed
> > in the past.
> > 
> > Anything else, I think it will be just like a hack
> > that will break
> > something else.
> [SNIP]
> I wouldn't take quite so extreme a position as that,
> but I agree that emulating j.t.Format is probably the
> "most correct" approach.  But our old buddy B.C. might
> not allow it...

Well, modifying the API of PropertyHelper may not be too risky.

If what we are changing if the implementation of replaceProperties()
keeping the same parameters. Then we should be 95% there.

The actual change is to add a method to PropertyHelper where you
use a kind of parseObject/format API from java.text.Format.
The default implementation will just collect to the next '}'
and pass to the current calls to get the value. But
this may be overridden to provide an implementation of PropertyHelper
that reads as much as it wants and decides on which '}' to stop.

So an expression evaluator for properties could count '{}' and
pick the segment it wants and then evaluate the whole thing at once.

Not sure of the details, but I think we can make it BC friendly.

Comments, ideas ....

Jose Alberto

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

View raw message