RFR 8152645 VarHandle lookup access control tests
claes.redestad at oracle.com
Mon Apr 11 11:02:24 UTC 2016
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.
>> 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/>
More information about the core-libs-dev