You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Henning Schmiedehausen (JIRA)" <de...@velocity.apache.org> on 2007/03/08 01:16:28 UTC

[jira] Closed: (VELOCITY-438) toString is called twice on references

     [ https://issues.apache.org/jira/browse/VELOCITY-438?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henning Schmiedehausen closed VELOCITY-438.
-------------------------------------------


> toString is called twice on references
> --------------------------------------
>
>                 Key: VELOCITY-438
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-438
>             Project: Velocity
>          Issue Type: Bug
>    Affects Versions: 1.5
>            Reporter: Stephen Haberman
>             Fix For: 1.5
>
>         Attachments: call_tostring_only_once.txt
>
>
> ASTReference.java has some null check logic that does, summarized:
> if (value == null || value.toString() == null) {
>    ...
> } else {
>   ... output value.toString();
> }
> Note value.toString() being called twice.
> For strings and other primitives, this may not be a big deal, but I'm happily using Click, which puts full-fledged components into the velocity context that you render with "$componentName". Very slick. But now calling toString() multiple times isn't all that cool, both from perf and logic standpoints.
> I've got a patch if I can figure out how to upload it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org