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

Hannes Wallnöfer hannes.wallnoefer at oracle.com
Mon Dec 4 16:09:12 UTC 2017


D'oh! I blindly clicked on that links of course :)

> Am 04.12.2017 um 17:05 schrieb Attila Szegedi <szegedia at gmail.com>:
> 
> I know, it’s subtle; that’s why I decided to describe it in detail :-)
> 
>> On 2017. Dec 4., at 16:36, Hannes Wallnöfer <hannes.wallnoefer at oracle.com> wrote:
>> 
>> Took me some time to spot the difference in behaviour (adaptation of method type in Binder)!
>> 
>> +1
>> 
>> Hannes
>> 
>>> Am 04.12.2017 um 13:40 schrieb Attila Szegedi <szegedia at gmail.com>:
>>> 
>>> 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