Discussion:
RFR: 8214795: Add safety check to dynalink inner class lookup
(too old to reply)
Hannes Wallnöfer
2018-12-05 14:33:09 UTC
Permalink
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
Sundararajan Athijegannathan
2018-12-05 14:57:05 UTC
Permalink
Looks good

-Sundar
Post by Hannes Wallnöfer
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
Sundararajan Athijegannathan
2018-12-05 14:55:42 UTC
Permalink
Looks good.

-Sundar
Post by Hannes Wallnöfer
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
Jim Laskey
2018-12-05 14:45:43 UTC
Permalink
Wouldn’t you still use innerClasses.putIfAbsent in case there is a race?
Post by Hannes Wallnöfer
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
Attila Szegedi
2018-12-05 15:26:00 UTC
Permalink
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.
Post by Jim Laskey
Wouldn’t you still use innerClasses.putIfAbsent in case there is a race?
Post by Hannes Wallnöfer
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
Attila Szegedi
2018-12-05 15:26:12 UTC
Permalink
+1
Post by Hannes Wallnöfer
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
Loading...