Re[2]: Patch-module with dynamic layer creating.

Alex Sviridov ooo_saturn7 at
Fri Oct 12 20:57:16 UTC 2018

Hi Alan,

Thank you for detailed explanation. It is great that we have API that allows to implement
such features. However, what I suggest is a little different. I am speaking about using
existing code for such features. 

I think this way - firstly, we can do write the same code many times. We can, but we 
don't want. Secondly if we pass parameters to JPMS via JVM options to configure boot 
layer, it would be great if we had possibility to pass the same parameters to configure a 
custom layer without writing a line of code and use existing JDK code. 

Of course this is my person opinion. It is interesting to hear what other developers think.

>Пятница, 12 октября 2018, 19:24 +03:00 от Alan Bateman <Alan.Bateman at>:
>On 12/10/2018 16:00, Alex Sviridov wrote:
>> I am speaking not only about patch-module but about all possible options:
>> --add-exports, --add-opens, --patch-module, --add-modules, --add-reads etc.
>ModuleLayer defines static variants of the defineModuleXXX methods that 
>return a Controller object that you can use to do the equivalent of 
>--add-reads or --add-exports/-add-opens to export/open a package to 
>specific modules. The equivalent of --add-modules is to add module name 
>to the set of modules to resolve.
>For patching then it does mean writing code and creating your own 
>ModuleFinder but it shouldn't be too difficult.

Alex Sviridov

More information about the jigsaw-dev mailing list