1

I am trying to call MethodHandle.invokeExact in a generated Javassist method, but I always get Exception in thread "main" javassist.CannotCompileException: [source error] invokeExact(int) not found in java.lang.invoke.MethodHandle

This seems to be because invokeExact is a @PolymorphicSignature method. How can I call it from a Javassist method?

Jire
  • 9,680
  • 14
  • 52
  • 87
  • 2
    If you want to do nontrivial bytecode manipulation, there is no way around doing it on the bytecode level. You may find out that it is easier than you thought. You may even ask yourself one day, how you could ever think, doing bytecode manipulation by compiling source code fragments at runtime was a good idea. – Holger Jan 20 '23 at 08:41

0 Answers0