RFR: JDK-8308913: Update core reflection for JEP 445 (preview) [v4]
Mandy Chung
mchung at openjdk.org
Fri Jun 2 18:45:08 UTC 2023
On Fri, 2 Jun 2023 18:09:23 GMT, Jim Laskey <jlaskey at openjdk.org> wrote:
>> Hmm. I think adding at least a check for ACC_FINAL should be fine as it should have near-zero cost on top of the existing predicate once the method get compiled. (In future iterations of the JEP, the idiom to identify isUnnamed will likely change.)
>
> As mentioned in https://bugs.openjdk.org/browse/JDK-8308916 the expression should be `PreviewFeatures.isEnabled() && isSynthetic() && isTopLevelClass()` as `PreviewFeatures.isEnabled()` is a private static final test that will effectively make the full expression constant `false` when not in preview mode.
Checking package access should also have near-zero cost.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14165#discussion_r1214695722
More information about the core-libs-dev
mailing list