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

Jie Kang jkang at redhat.com
Fri Jun 20 14:22:59 UTC 2014


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: 5569 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20140620/89107d75/liveconnect-methodoverload.patch>


More information about the distro-pkg-dev mailing list