Rafael Winterhalter
Rafael Winterhalter
This will not work as `ClassA` does not know about `ClassB` methods. MethodCall.invoke(ClassB.class.getMethod("method2")).on(new ClassA()) Since you defined a field, maybe you were looking for `onField`?
Mostly because I am also trying to run the build on old JVMs to test byte code manipulation in these environments. Any plugin makes me struggle with baseline versions.
I think it is really working well, because you define a Gradle build and run it as you would from the command line. It needs some adjustments for OS, but...
Does this occur generally? Could you give some more context on the error? Maybe run with debug and show a stack.
Good point. It is already supported in the delegation, I just added the support to the other ones.
Possibly, this is because classes are loaded by the agent during instrumentation? If so, the classes are ignored to avoid circularities. You can try reiteration: https://github.com/raphw/byte-buddy/blob/master/byte-buddy-dep/src/main/java/net/bytebuddy/agent/builder/AgentBuilder.java#L7139
Just fixed the formatting, but I would recommend to add this to allow for debugging on a more local level.
I think this could be valuable to have available if you suddenly encountered illegal byte code. It does not come with overhead, if deactivated, so I'd merge it in.
For my part, we can add it. Annotations would be ignored if they are not found, so this can just be added.
You could attempt a dynamic constant with constandynamic. This requires that the class can access a bootstrap method and a class level of Java 11.