[rfc][icedtea-web] LiveConnect Method Overload Resolver Fix

Jiri Vanek jvanek at redhat.com
Mon Jun 23 14:44:02 UTC 2014


CC Adam as original author. Also he accidentaly proved he is still "Alive out there" So W ecanhope 
to catch him :)
On 06/20/2014 04:22 PM, Jie Kang wrote:
> Hello,
>
> When refactoring the LiveConnect tests I discovered a bug in the MethodOverloadResolver implementation where choosing the correct superclass did not take into account the hierarchy distance. This was causing JSToJFuncResolTest - AppletJSToJFuncResol_inheritedClassToParent1_Test to fail intermittently.
>
> E.g.
>
> A extends B extends C : Object of Type C is passed as argument to function that accepts either Type A or Type B objects. As per LiveConnect and Java specification, the correct resolution of this is to use the function that accepts Type B. However, the implementation of MethodOverloadResolver did not comply with this and nearly always used the Type A function (both Type A and Type B functions were scored equally and the choice of use depended on the order of comparison, which is not always the same).
>
> The patch resolves this issue by following LiveConnect specification located here:
> https://jdk6.java.net/plugin2/liveconnect/#OVERLOADED_METHODS
> where a distance calculation for class hierarchy is used to resolve the issue. It also removes the Known to Fail annotation for the test case which should no longer fail.
>
>
> Regards,
>
> --
> Jie Kang
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: liveconnect-methodoverload.patch
Type: text/x-patch
Size: 5570 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20140623/9bd830cb/liveconnect-methodoverload.patch>


More information about the distro-pkg-dev mailing list