Tapestry 5
  1. Tapestry 5
  2. TAP5-1549

ParameterWorker forces evaluation of default method, even if the parameter is bound by other means

    Details

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

      Description

      The revised implementation of ParameterWorker evaluates the defaultXXX method regardless of whether or not the parameter is bound. This can easily lead to application exceptions, particularly when the defaultXXX value is computed rather than static.

      For example, loop's "encoder" parameter attempts to get a ValueEncoder from ValueEncoderSource. This will fail if, for instance, the loop's value is a hibernate entity with a multi-column PK, even if the developer binds a custom ValueEncoder to the parameter to handle the entity. Admittedly, this case has a workaround: contribute the custom encoder to ValueEncoderSource. But that's only one edge case.

      The correct solution is to lazily evaluate defaultXXX methods.

        Activity

        Robert Zeigler created issue -
        Robert Zeigler made changes -
        Field Original Value New Value
        Assignee Robert Zeigler [ ongakugainochi ]
        Howard M. Lewis Ship made changes -
        Assignee Robert Zeigler [ ongakugainochi ] Howard M. Lewis Ship [ hlship ]
        Howard M. Lewis Ship made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Howard M. Lewis Ship made changes -
        Summary ParameterWorker forces evaluation of defaultXXX methods, even if the parameter is bound ParameterWorker forces evaluation of default method, even if the parameter is bound by other means
        Howard M. Lewis Ship made changes -
        Status In Progress [ 3 ] Closed [ 6 ]
        Fix Version/s 5.3 [ 12316024 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Robert Zeigler
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development