Re: Fwd: Calling a method with parameters (String, Object[])

Daniel Dekany <[email protected]> Mon, 27 Jan 2014 02:33:03 +0100
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
This is now fixed in the trunk (but only if you activate 2.3.21 fixes;
see my earlier mail): https://github.com/freemarker/freemarker,
2.3-gae. (It's supposed to be trivial to build, and it never hurts if
you test it too.)

-- 
Thanks,
 Daniel Dekany


Saturday, January 25, 2014, 12:06:29 PM, Daniel Dekany wrote:

> Hello,
>
> In short, seems for now you have to work this around as you said...
> later you can start using a fixed FM though where this won't be
> necessary. And thanks for noticing this!
>
> Said longer... I'm certain I can figure out a fix for this in 2.3.21,
> however that's far away from being released. Although the fix of this
> will be probably in the trunk soon, and the current state of trunk
> should be stable. For the fix to be activated in 2.3.21 or in the
> trunk, the "object_wrapper" setting value has to be a BeansWrapper
> (like a DefaultObjectWrapper) that was created/getInstance-d with
> Version(2, 3, 21) argument, or else the legacy behavior will be
> emulated for backward compatibility. Or if you leave "object_wrapper"
> at its default value, setting the "incompatible_improvement" setting
> of the Configuration object has similar effect, although that actives
> some other not-100%-backward-compatible fixes too. Note that
> overloaded method selection was heavily reworked in 2.3.21, so there
> are other changes too. (Why even that fails in this seemingly simple
> case? The common type of the parameters on the 2nd position is
> java.io.Serializable. So then FM concludes that whatever value it
> comes up with for that position, it must be Serializable. That would
> be fine, if it was a true requirement, but Java has this quirk that
> Object[] is Serializible, despite you can't know if its items will be
> Serializable, while java.util.List (the "default" Java-type of the FTL
> sequence type) is rightfully not Serializable. That's ultimately why
> FM thinks the conversion won't work out and it doesn't "unwrap" the
> sequence.)


------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk