Tapestry 5
  1. Tapestry 5
  2. TAP5-1621

TypeCoercer currently uses Object -> String and String -> Boolean, there should be a direct coercion from Object -> Boolean for <t:if/> performance.


    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.3
    • Fix Version/s: 5.3
    • Component/s: tapestry-core
    • Labels:


      An issue was raised in this thread:

      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.


        Josh Canfield created issue -
        Josh Canfield made changes -
        Field Original Value New Value
        Assignee Josh Canfield [ joshcanfield ]
        Josh Canfield made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 5.3 [ 12316024 ]
        Resolution Fixed [ 1 ]
        Josh Canfield made changes -
        Status Resolved [ 5 ] Closed [ 6 ]


          • Assignee:
            Josh Canfield
            Josh Canfield
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: