Skip to content

Commit

Permalink
fix: asm 工具类支持类 signature
Browse files Browse the repository at this point in the history
  • Loading branch information
limaofeng committed Oct 11, 2022
1 parent 54e96db commit a27a65f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion core/src/main/java/org/jfantasy/framework/util/asm/AsmUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,16 @@ public static Class makeClass(
Class[] interfaces,
Property[] properties,
MethodInfo[] methodInfos) {
return makeClass(className, null, superClassName, interfaces, properties, methodInfos);
}

public static Class makeClass(
String className,
String signature,
String superClassName,
Class[] interfaces,
Property[] properties,
MethodInfo[] methodInfos) {
ClassWriter cw = new ClassWriter(F_FULL);

String newClassInternalName = className.replace('.', '/');
Expand All @@ -273,7 +283,7 @@ public static Class makeClass(
Label l0 = new Label();
Label l1 = new Label();

cw.visit(V1_6, ACC_PUBLIC, newClassInternalName, null, superClassInternalName, iteRs);
cw.visit(V1_6, ACC_PUBLIC, newClassInternalName, signature, superClassInternalName, iteRs);

cw.visitSource(RegexpUtil.parseGroup(className, "\\.([A-Za-z0-9_$]+)$", 1) + ".java", null);

Expand Down

0 comments on commit a27a65f

Please sign in to comment.