ModuleLayer.Controller strongly references Module

Michał Kłeczek michal at kleczek.org
Sun Nov 28 22:29:36 UTC 2021



> On 24 Nov 2021, at 21:01, Alan Bateman <Alan.Bateman at oracle.com> wrote:
> 
> On 24/11/2021 18:14, Michał Kłeczek wrote:
>> 
>> 
>> For sure it’s fun :)
>> 
>> Regardless of “smart proxies” the lifetime of ML.Controller should be - if not fixed - at least be documented IMHO. Right now it’s a minefield.
> 
> It's also somewhat unusual so I think we'll need to think if this is the right thing to do.

It looks like ML.Controller.addExport(source, pn, target) does not update the target module ClassLoader view of exported packages in the default ClassLoader implementation (jdk.internal.loader.Loader).
What is the reasoning behind such implementation? I am wondering now how useful Controller.addExport() really is...

-- Michal


More information about the jigsaw-dev mailing list