commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Gregory" <ggreg...@seagullsoftware.com>
Subject RE: [lang] IllegalStateException in text.VariableFormatter with "empty" keys.
Date Mon, 25 Jul 2005 20:52:32 GMT
Patch applied, thank you Oliver.

Gary

> -----Original Message-----
> From: Oliver Heger [mailto:oliver.heger@t-online.de]
> Sent: Monday, July 25, 2005 12:05 PM
> To: Jakarta Commons Developers List
> Subject: Re: [lang] IllegalStateException in text.VariableFormatter
with
> "empty" keys.
> 
> Gary Gregory wrote:
> 
> >Oliver and all:
> >
> >The text.VariableFormatter class throws an IllegalStateException for
the
> >template "The ${} jumps over the ${}.":
> >
> >java.lang.IllegalStateException: Infinite loop in property
interpolation
> >of The ${} jumps over the ${}.: ->
> >	at
>
>org.apache.commons.lang.text.VariableFormatter.doReplace(VariableFormat
t
> >er.java:380)
> >	at
>
>org.apache.commons.lang.text.VariableFormatter.replaceObject(VariableFo
r
> >matter.java:513)
> >	at
>
>org.apache.commons.lang.text.VariableFormatterTest.testReplaceNoElement
(
> >VariableFormatterTest.java:230)
> >	at
>
>org.apache.commons.lang.text.VariableFormatterTest.testReplaceNoEmptyKe
y
> >s(VariableFormatterTest.java:263)
> >
> >
> >I would think that replaceObject should just return the pattern
string,
> >which is what happens when other kinds of malformed patterns are
> >submitted.
> >
> >Could you fix this? Or do you think this is really the proper
behavior?
> >
> >Thanks,
> >Gary
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >
> >
> >
> >
> Attached is a fix (if the list lets it through). The problem was that
> variables that could not be resolved were not removed from the
> priorVariables list. Good test case!
> 
> Oliver

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