Skip to content

Instantly share code, notes, and snippets.

@tabjy
Last active November 20, 2019 15:33
Show Gist options
  • Save tabjy/60c538728bd05cc13c4443d826e0b953 to your computer and use it in GitHub Desktop.
Save tabjy/60c538728bd05cc13c4443d826e0b953 to your computer and use it in GitHub Desktop.
pre java 11 bridge method for nested access
Classfile /home/kxu/Documents/github.com/tabjy/java-snippets/target/classes/com/tabjy/snippets/asm/path_syntax_evaluation/Pojo.class
Last modified Nov 20, 2019; size 800 bytes
MD5 checksum ce2027f5c28d4f1634e8c67ef84efd97
Compiled from "Pojo.java"
public class com.tabjy.snippets.asm.path_syntax_evaluation.Pojo
minor version: 0
major version: 55
flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: #9 // com/tabjy/snippets/asm/path_syntax_evaluation/Pojo
super_class: #10 // java/lang/Object
interfaces: 0, fields: 7, methods: 2, attributes: 3
Constant pool:
#1 = Methodref #10.#33 // java/lang/Object."<init>":()V
#2 = Fieldref #9.#34 // com/tabjy/snippets/asm/path_syntax_evaluation/Pojo.dynamicField:I
#3 = Fieldref #9.#35 // com/tabjy/snippets/asm/path_syntax_evaluation/Pojo.STATIC_FIELD:I
#4 = Fieldref #9.#36 // com/tabjy/snippets/asm/path_syntax_evaluation/Pojo.thePublic:I
#5 = Fieldref #9.#37 // com/tabjy/snippets/asm/path_syntax_evaluation/Pojo.theProtected:I
#6 = Fieldref #9.#38 // com/tabjy/snippets/asm/path_syntax_evaluation/Pojo.thePrivate:I
#7 = Fieldref #9.#39 // com/tabjy/snippets/asm/path_syntax_evaluation/Pojo.thePackagePrivate:I
#8 = Fieldref #9.#40 // com/tabjy/snippets/asm/path_syntax_evaluation/Pojo.INSTANCE:Lcom/tabjy/snippets/asm/path_syntax_evaluation/Pojo;
#9 = Class #41 // com/tabjy/snippets/asm/path_syntax_evaluation/Pojo
#10 = Class #42 // java/lang/Object
#11 = Class #43 // com/tabjy/snippets/asm/path_syntax_evaluation/Pojo$NestPojo
#12 = Utf8 NestPojo
#13 = Utf8 InnerClasses
#14 = Utf8 STATIC_FIELD
#15 = Utf8 I
#16 = Utf8 dynamicField
#17 = Utf8 thePublic
#18 = Utf8 theProtected
#19 = Utf8 thePrivate
#20 = Utf8 thePackagePrivate
#21 = Utf8 INSTANCE
#22 = Utf8 Lcom/tabjy/snippets/asm/path_syntax_evaluation/Pojo;
#23 = Utf8 <init>
#24 = Utf8 ()V
#25 = Utf8 Code
#26 = Utf8 LineNumberTable
#27 = Utf8 LocalVariableTable
#28 = Utf8 this
#29 = Utf8 <clinit>
#30 = Utf8 SourceFile
#31 = Utf8 Pojo.java
#32 = Utf8 NestMembers
#33 = NameAndType #23:#24 // "<init>":()V
#34 = NameAndType #16:#15 // dynamicField:I
#35 = NameAndType #14:#15 // STATIC_FIELD:I
#36 = NameAndType #17:#15 // thePublic:I
#37 = NameAndType #18:#15 // theProtected:I
#38 = NameAndType #19:#15 // thePrivate:I
#39 = NameAndType #20:#15 // thePackagePrivate:I
#40 = NameAndType #21:#22 // INSTANCE:Lcom/tabjy/snippets/asm/path_syntax_evaluation/Pojo;
#41 = Utf8 com/tabjy/snippets/asm/path_syntax_evaluation/Pojo
#42 = Utf8 java/lang/Object
#43 = Utf8 com/tabjy/snippets/asm/path_syntax_evaluation/Pojo$NestPojo
{
public static int STATIC_FIELD;
descriptor: I
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
public static int thePublic;
descriptor: I
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
protected static int theProtected;
descriptor: I
flags: (0x000c) ACC_PROTECTED, ACC_STATIC
static int thePackagePrivate;
descriptor: I
flags: (0x0008) ACC_STATIC
public static com.tabjy.snippets.asm.path_syntax_evaluation.Pojo INSTANCE;
descriptor: Lcom/tabjy/snippets/asm/path_syntax_evaluation/Pojo;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
public com.tabjy.snippets.asm.path_syntax_evaluation.Pojo();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=1, args_size=1
0: aload_0
1: invokespecial #1 // Method java/lang/Object."<init>":()V
4: aload_0
5: bipush 42
7: putfield #2 // Field dynamicField:I
10: return
LineNumberTable:
line 3: 0
line 5: 4
LocalVariableTable:
Start Length Slot Name Signature
0 11 0 this Lcom/tabjy/snippets/asm/path_syntax_evaluation/Pojo;
static {};
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=1, locals=0, args_size=0
0: bipush 42
2: putstatic #3 // Field STATIC_FIELD:I
5: bipush 42
7: putstatic #4 // Field thePublic:I
10: bipush 42
12: putstatic #5 // Field theProtected:I
15: bipush 42
17: putstatic #6 // Field thePrivate:I
20: bipush 42
22: putstatic #7 // Field thePackagePrivate:I
25: aconst_null
26: putstatic #8 // Field INSTANCE:Lcom/tabjy/snippets/asm/path_syntax_evaluation/Pojo;
29: return
LineNumberTable:
line 4: 0
line 7: 5
line 8: 10
line 9: 15
line 10: 20
line 12: 25
}
SourceFile: "Pojo.java"
NestMembers:
com/tabjy/snippets/asm/path_syntax_evaluation/Pojo$NestPojo
InnerClasses:
public #12= #11 of #9; // NestPojo=class com/tabjy/snippets/asm/path_syntax_evaluation/Pojo$NestPojo of class com/tabjy/snippets/asm/path_syntax_evaluation/Pojo
Classfile /home/kxu/Documents/github.com/tabjy/java-snippets/target/classes/com/tabjy/snippets/reflection/MyClass.class
Last modified Nov 19, 2019; size 657 bytes
MD5 checksum e63724b0e3e1584120e7b6ff4c439a0a
Compiled from "MyClass.java"
public class com.tabjy.snippets.reflection.MyClass
minor version: 0
major version: 52
flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: #4 // com/tabjy/snippets/reflection/MyClass
super_class: #5 // java/lang/Object
interfaces: 0, fields: 1, methods: 3, attributes: 2
Constant pool:
#1 = Fieldref #4.#26 // com/tabjy/snippets/reflection/MyClass.thePrivate:I
#2 = Methodref #5.#27 // java/lang/Object."<init>":()V
#3 = Methodref #6.#28 // com/tabjy/snippets/reflection/MyClass$MyInnerClass.printThePrivate:()V
#4 = Class #29 // com/tabjy/snippets/reflection/MyClass
#5 = Class #30 // java/lang/Object
#6 = Class #31 // com/tabjy/snippets/reflection/MyClass$MyInnerClass
#7 = Utf8 MyInnerClass
#8 = Utf8 InnerClasses
#9 = Utf8 thePrivate
#10 = Utf8 I
#11 = Utf8 <init>
#12 = Utf8 ()V
#13 = Utf8 Code
#14 = Utf8 LineNumberTable
#15 = Utf8 LocalVariableTable
#16 = Utf8 this
#17 = Utf8 Lcom/tabjy/snippets/reflection/MyClass;
#18 = Utf8 main
#19 = Utf8 ([Ljava/lang/String;)V
#20 = Utf8 args
#21 = Utf8 [Ljava/lang/String;
#22 = Utf8 access$000
#23 = Utf8 ()I
#24 = Utf8 SourceFile
#25 = Utf8 MyClass.java
#26 = NameAndType #9:#10 // thePrivate:I
#27 = NameAndType #11:#12 // "<init>":()V
#28 = NameAndType #32:#12 // printThePrivate:()V
#29 = Utf8 com/tabjy/snippets/reflection/MyClass
#30 = Utf8 java/lang/Object
#31 = Utf8 com/tabjy/snippets/reflection/MyClass$MyInnerClass
#32 = Utf8 printThePrivate
{
public com.tabjy.snippets.reflection.MyClass();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
0: aload_0
1: invokespecial #2 // Method java/lang/Object."<init>":()V
4: return
LineNumberTable:
line 3: 0
LocalVariableTable:
Start Length Slot Name Signature
0 5 0 this Lcom/tabjy/snippets/reflection/MyClass;
public static void main(java.lang.String[]);
descriptor: ([Ljava/lang/String;)V
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=0, locals=1, args_size=1
0: invokestatic #3 // Method com/tabjy/snippets/reflection/MyClass$MyInnerClass.printThePrivate:()V
3: return
LineNumberTable:
line 13: 0
line 14: 3
LocalVariableTable:
Start Length Slot Name Signature
0 4 0 args [Ljava/lang/String;
static int access$000();
descriptor: ()I
flags: (0x1008) ACC_STATIC, ACC_SYNTHETIC
Code:
stack=1, locals=0, args_size=0
0: getstatic #1 // Field thePrivate:I
3: ireturn
LineNumberTable:
line 3: 0
}
SourceFile: "MyClass.java"
InnerClasses:
public static #7= #6 of #4; // MyInnerClass=class com/tabjy/snippets/reflection/MyClass$MyInnerClass of class com/tabjy/snippets/reflection/MyClass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment