Instrumentation.redefineModule -- extraPackages argument?

Michael Rasmussen michael.rasmussen at
Sat Mar 11 13:31:08 UTC 2017

Looking a bit closer in the source, and not just the public API, I did find
addPackage in the private API part of Module (and the corresponding
native JVM_AddModulePackage).
So the capability for dynamically evolving a named module is present,
supported, and utilized by Proxy!

Adding a new package isn't just for use-cases of development, modules that
dynamically expand have other use cases as well, for instance classes
dynamically created at runtime based on factors that cannot be determined
at compile time (well, proxy is a good example of that, and as mentioned
already does exactly this!).

Also, as Jochen pointed out, setting up a new classloader with new layers
and modules etc, is a non-trivial task, just for adding a new package --
especially considering the functionality is present, just not public.

sure, from JRebel's point of view, a method being non-public isn't exactly
an obstacle for us; but "normal" frameworks don't have that luxury.


More information about the jigsaw-dev mailing list