RFR 8152645 VarHandle lookup access control tests
Paul Sandoz
paul.sandoz at oracle.com
Mon Apr 11 11:27:52 UTC 2016
> On 11 Apr 2016, at 13:02, Claes Redestad <claes.redestad at oracle.com> wrote:
>
> On 2016-04-11 12:03, Paul Sandoz wrote:
>>> On 8 Apr 2016, at 15:37, Michael Haupt <michael.haupt at oracle.com> wrote:
>>>
>>> Hi Paul,
>>>
>>> note this is a lower-case review. Thumbs up.
>>>
>>> I like how the test lucidly documents the access rules, and would applaud an extended test that additionally covers module boundaries.
>
> +1
>
I’ll follow up later with that, https://bugs.openjdk.java.net/browse/JDK-8153963 <https://bugs.openjdk.java.net/browse/JDK-8153963>
>>>
>>> Just as a suggestion, how about using the fact that enum values are technically instances of subclasses of the enum and getting rid of the switches in FieldLookup.lookup/isAccessibleField by replacing the two with overridden methods in each of the enum elements? Switching over "this" just calls for polymorphism, and the default cases are dead code. Admittedly, it's a matter of style. :-)
>>>
>> Done, updated in place:
>>
>> http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8152645-VH-access-control/webrev/ <http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8152645-VH-access-control/webrev/>
>
> Looks good.
>
Thanks,
Paul.
More information about the core-libs-dev
mailing list