RFR 8152645 VarHandle lookup access control tests
paul.sandoz at oracle.com
Mon Apr 11 10:03:36 UTC 2016
> 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:
More information about the core-libs-dev