Accessing module internals from bytecode rewriting agent

Jeremy Manson jeremymanson at
Tue Apr 25 07:14:05 UTC 2017


It wouldn't have occurred to me that I needed to use a Java 9 API.  I can't
remember ever having an upgrade path for anything in any Java version for
which I couldn't use the same code in Java N and Java N+1, if the use case
was a supported part of the spec in both.

The usual migration path we have is to make all of our code work in both
JDK N and JDK N+1, and then flip the switch to migrate to N+1.  I expect we
are not alone in that.

I guess I can call it reflectively.

This is pretty nice, otherwise, because we have lots of reflective hacks
into the JDK in our codebase, and it gives us a way to do the ones we can't
do with Unsafe. :)


On Mon, Apr 24, 2017 at 11:50 PM, Alan Bateman <Alan.Bateman at>

> On 25/04/2017 07:29, Jeremy Manson wrote:
> Ah, then it sounds as if I just don't know what I'm doing.  Any pointers?
>> This should help:
> ment/Instrumentation.html#redefineModule-java.lang.Modul
> e-java.util.Set-java.util.Map-java.util.Map-java.util.Set-java.util.Map-
> -Alan

More information about the jigsaw-dev mailing list