On Tue, 12 Apr 2022 01:15:33 GMT, David Holmes <dhol...@openjdk.org> wrote:

> > checkExactAccessMode -> checkAccessModeThenIsDirect
> 
> Don't you still want "Exact" in there? That "access" check seems odd anyway 
> as it only checks for one form of mismatch - should it not also check for 
> `!exact && accessModeType(ad.type) == ad.symbolicMethodTypeExact`?

What's checked is that the access mode is nominally OK. It just so happens that 
the only rule validated up front is that iff the VH is exact then the types 
must be an exact match. 

For non-exact VH sufficient checks will be done later, eg. by the `asType` call 
(if the type of the VH isn't adaptable to `ad.symbolicMethodTypeInvoker` this 
will throw an exception).

With that in mind then the name `checkExactAccessMode` even appears misleading 
as it can be interpreted that the VH _must_ be `exact`. Which is not the case. 
Dropping the `Exact` part makes it less ambiguous.

-------------

PR: https://git.openjdk.java.net/jdk/pull/8160

Reply via email to