On 05/18/2012 02:45 AM, Adrian Crum wrote: > On 5/18/2012 5:50 AM, Adam Heath wrote: >> On 05/17/2012 12:23 PM, Jacopo Cappellato wrote: >>> file are attached; that bug tracker is really awful. >> >> This is all becoming very troubling. >> >> == example methods >> String a(String name, List list) {} >> String a(String name, Map map) {} >> String a(Object[] args) {} >> >> String b(String name, List list) {} >> String b(String name, Map map) {} >> String b(Object... args) {} >> >> == example templates >> ${object.a(string, null)} >> ${object.b(string, null)} >> >> == >> >> In 2.3.18, freemarker can't find any methods at all. In 2.3.19, it >> can find the b vararg method. In either situation, that is wrong. >> >> The correct situation for both is to say there are 2 matching >> methods, the List and Map variants. Without my patch, when a null >> is used, any non-primitive method will never be considered as a >> possible candidate. >> >> I'm still discussing with freemarker upstream, but I get the feeling >> that they won't provide a fix for the 2.3 branch, and a true, >> correct fix for 2.4 will be long in coming. >> >> This means we need to come up with a workaround for ofbiz. I'm up >> for suggestions. We really can't undo the change, that just doesn't >> seem right to me. >> . > > In my experience with FreeMarker, there are a lot of things that are > replaceable - like TemplateLoader and TemplateExceptionHandler. Does > FreeMarker have a "Object Method Resolver" that we can replace? Would > a custom BeansWrapper help?
I'm currently in discussion with upstream(1), they may give me commit rights after I sign a CLA. Their suggestion right now is a new property on BeansWrapper. 1: https://sourceforge.net/tracker/?func=detail&aid=3527625&group_id=794&atid=100794#