InstrumentationServer
InstrumentationServer copied to clipboard
Recorded bytecode may not be correct, caching must be done as the last transformer
There is no guarantee that our transformer is the last in the chain atm. So we may not be given the most up-to-date bytecode from another transformer.
From xxDark
JVM will run all class file transformers when class is redefined, so
redefineClassfunction should not cache class bytecode, your transformer should do that instead (you also need to keep it at the end of the list of the transformers so it is ran last) CallingretransformClassesthough will probably cause allinvokedynamicsto bootstrap again, so it can be used to detect instrumentation, not sure what to do here tbh, but thats the only way to get actual bytecode of the class