0

I am trying to change the class reference of a lambda class in it's constant pool. I've found a way to change it's name, but I need to change the class reference too since it remains the same (e.g. CapturingClass$$Lambda$counter). I want the class reference to point to a new name (e.g. CapturingClass$$Lambda$newIdentifier). Anyone who have an idea how to achieve this using ASM?

Unfortunately, I have not been lucky so far. I found no solutions on the internet.

NO ONE
  • 33
  • 6
  • 3
    You can not change lambda classes in general. You can use the ASM library to create a new class file but that’s independent of the runtime lambda class. Besides that, ASM is not designed to perform redirection directly on the constant pool. The intended use case is to iterate over the members and do redirection at the place of actual use, then, ASM will generate the right constant pool for you. – Holger Jun 30 '23 at 17:17

0 Answers0