Posts

Showing posts with the label BoundMethodHandle

What is Java Synthetic Class (ACC_SYNTHETIC)? with the example of BoundMethodHandle$1.class in Java package java.lang.invoke

Image
When a .class file marked with the ACC_SYNTHETIC flag, it indicates the .class file was generated by compiler and does not appear in the corresponding .java source code . Binary Code is always the best document, so let's check an example: the BoundMethodHandle$1.class class in java.base.jmod in JDK. The class file BoundMethodHandle$1.class has been marked as synthetic flag, as shown bellow: Basic Information of BoundMethodHandle$1.class  UML diagram of BoundMethodHandle$1.class And this class is used by the container class BoundMethodHandle : Dependency Network diagram of BoundMethodHandle$1.class This class does not exist in the original source code BoundMethodHandle.java , but generated by the java compiler, from the following two (2) methods in the Java class BoundMethodHandle : BoundMethodHandle.bindSingle() , at byte code offset 0 BoundMethodHandle.arg() , at byte code offset 17 Byte code of method BoundMethodHandle.bindSingle() ...