If you read carefully the code you'll see that the calls are in if/else.
The first call is called only if the returned 'value' is non-null. The
second is called only if the value was null and defaultValue is used.

On Wed, Jul 27, 2011 at 5:30 AM, Martin Makundi
<martin.maku...@koodaripalvelut.com> wrote:
> Hi!
>
> In wicket 1.4.17 it seems like there is deouble invocation of
> substitutePropertyExpressions, is this intentional?
>
>    public String getString(final String key, final Component component,
> final IModel<?> model,
>        final String defaultValue) throws MissingResourceException
>    {
>       ...
>        String value = getStringIgnoreSettings(key, component, model, null);
> ---> calls substitutePropertyExpressions(component, value, model);
>       ...
>          if (value != null)
>        {
>            return substitutePropertyExpressions(component, value, model);
>        }
>       ...
>    {
>
> and inside getStringIgnoreSettings:
>
>    public String getStringIgnoreSettings(final String key, final Component
> component,
>        final IModel<?> model, final String defaultValue)
>    {
>       ...
>          if (value != null)
>        {
>            return substitutePropertyExpressions(component, value, model);
>        }
>       ...
>    {
>
>
> Seems redundant and might have some performance considerations?
>
> **
> Martin
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

Reply via email to