Search code examples
javajava-bytecode-asm

How to read lambda expression bytecode using ASM


How can I read the bytecode instructions from the body of a lambda expression using ASM?


Solution

  • A lambda compiles to a static method with a synthetic name. So to read the code using ASM, you would reverse engineer the method name ... then read it like any other method.

    But if you just want to look at the bytecode for the lambda, it is simpler to use javap.