You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Josh Canfield (JIRA)" <ji...@apache.org> on 2011/09/09 18:53:09 UTC

[jira] [Resolved] (TAP5-1621) TypeCoercer currently uses Object -> String and String -> Boolean, there should be a direct coercion from Object -> Boolean for performance.

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

Josh Canfield resolved TAP5-1621.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 5.3

> TypeCoercer currently uses Object -> String and String -> Boolean, there should be a direct coercion from Object -> Boolean for <t:if/> performance.
> ----------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1621
>                 URL: https://issues.apache.org/jira/browse/TAP5-1621
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.3
>            Reporter: Josh Canfield
>            Assignee: Josh Canfield
>             Fix For: 5.3
>
>
> An issue was raised in this thread:
> http://tapestry.1045711.n5.nabble.com/Null-check-property-expression-syntax-td4726386.html
> Describing the problem where:
> <t:if test="MyObject">
> causes MyObject to be coerced to a String before being coerced to a Boolean. For some objects this may be an expensive operation, and the common case (how often is the Entity you are editing on a page actually null?)
> Adding an explicit Object -> Boolean coercion will remove the need for the Object -> String coercion.
> A Number -> Boolean coercion is also required to prevent Integer -> Boolean from choosing the Object -> Boolean as a match (currently it goes Integer -> Long -> Boolean)
> At this point the only known issue is that any POJO that depends on the fact that returning "false" from toString will cause the Object -> String -> Boolean to return false will be broken. This seems like an unlikely case and can be worked around by providing a specific TypeCoercion for that object.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira