[code-reflection] RFR: Make Quotable a marker interface [v4]

Mourad Abbay mabbay at openjdk.org
Thu Jan 9 00:52:11 UTC 2025


On Wed, 8 Jan 2025 22:53:27 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:

>> There's actually three modules:
>> 1. the module in which capture occurs (e.g. where the quotable lambda is)
>> 2. `java.base` which is where the lambda metafactory is
>> 3. `jdk.incubator.code` which is where the code reflection code is
>> 
>> I'm not sure if the problem @mabbay is describing has to do with `Quotable2` not being accessible from (1) or (2). Putting the new interface in `java.base` will obviously address accessibility from (2). But I think there's still issues with respect to (1) ?
>> 
>> E.g. `InnerClassLambdaMetafactory`, at the end of the day, will call `defineClass` on the _caller_ lookup (e.g. the one in (1)). If the class being defined contains a symbolic reference to a non-exported interface, wouldn't that be an issue, regardless of whether the non-exported interface is in `java.base` or `jdk.incubator.code` ?
>
> Ah yes, that will likely throw an `IllegalAccessError`. (I seem to recall we ran into this before when trying to add internal marker interfaces to FI implementations?)

The issue I'm describing is that the class defined by LambdaMetaFactory will be in unnamed module and  can't access to Quotable2, because its package isn't exported.

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

PR Review Comment: https://git.openjdk.org/babylon/pull/302#discussion_r1908045821


More information about the babylon-dev mailing list