Review request for JDK-8192970: Element getters/setters with fixed key fail to link properly

Sundararajan Athijegannathan sundararajan.athijegannathan at oracle.com
Thu Dec 7 03:36:43 UTC 2017


Looks good.

PS. Sorry for the delayed response.

-Sundar

On 04/12/17, 6:10 PM, Attila Szegedi wrote:
> Please review JDK-8192970 "Element getters/setters with fixed key fail to link properly" at<http://cr.openjdk.java.net/~attila/8192970/webrev.jdk>  for<https://bugs.openjdk.java.net/browse/JDK-8192970>
>
> Note that this is unrelated to the previous refactoring (8191878), it is present even before that and also in JDK9, I’ll have to separately produce a backport fix for it. I discovered this while trying to expand the test coverage (and good thing that I did, too…)
>
> The gist of the problem is that convertArgToNumber as it was before will fail with IndexOutOfBoundsException invoking parameterType(1) on method type for fixed-key getters, as they only have one parameter at index 0.
>
> The fix is to move the logic into the Binder and use the methodType it manages, not the call site method type. This works because Binder always works with a method type as if the getter/setter were variable-key (it adds back the parameter type in its constructor if the operation is for a fixed key).
>
> Thanks,
>    Attila.


More information about the nashorn-dev mailing list