RFR: 8214795: Add safety check to dynalink inner class lookup

Attila Szegedi szegedia at gmail.com
Wed Dec 5 15:26:00 UTC 2018


This code is ultimately invoked from BeanLinker constructor, so always on a single thread; there’s no race here. putIfAbsent was used here previously solely for its effect of not replacing existing mappings, not because of its atomicity.

Attila.

> On 2018. Dec 5., at 15:45, Jim Laskey <james.laskey at oracle.com> wrote:
> 
> Wouldn’t you still use innerClasses.putIfAbsent in case there is a race?
> 
>> On Dec 5, 2018, at 10:33 AM, Hannes Wallnöfer <hannes.wallnoefer at oracle.com> wrote:
>> 
>> Please review:
>> 
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8214795
>> Webrev: http://cr.openjdk.java.net/~hannesw/8214795/webrev.00/
>> 
>> This is to make sure we use the right inner classes regardless of the order of classes returned by Class.getClasses().
>> 
>> Thanks,
>> Hannes
> 



More information about the nashorn-dev mailing list