Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
5.2.5
-
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.