JDK 9 RFR: JDK-8177146 MethodHandles.Lookup::bind allows illegal protected access
Claes Redestad
claes.redestad at oracle.com
Wed Apr 26 18:06:07 UTC 2017
Hi,
looks good to me!
Nit: I prefer descriptive test names, but can't find the creativity to suggest a better name in this case.
Thanks!
/Claes
Ron Pressler <ron.pressler at oracle.com> skrev: (26 april 2017 18:50:16 CEST)
>Hi.
>Please review,
>
>Bug: https://bugs.openjdk.java.net/browse/JDK-8177146
>Webrev:
>http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8177146-bind-protected-method/webrev/
>
>-----
>
>The patch contains a few changes:
>
>1. The method `getDirectMethodCommon`, was changed so that if narrowing
>
>due to protected method access must be done, it will be done regardless
>
>of the flag doRestrict.
>
>2. The private method ` getDirectMethodNoRestrict` was renamed to `
>getDirectMethodNoRestrictInvokeSpecial`.
>
>3. The method `bind` was changed to throw the correct exception type,
>IAException.
>
>4. `restrictReceiver` was changed such that it never widens the
>receiver
>type. This could happen when the receiver was a subclass of the caller
>class, and triggered the assertion (this happened not only in calls to
>`bind` but also to `findVirtual`).
>
>-----
>
>Thanks
>Ron
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
More information about the core-libs-dev
mailing list