Skip to content

Commit

Permalink
修复抽象方法被丢弃问题
Browse files Browse the repository at this point in the history
  • Loading branch information
maoabc committed Mar 15, 2023
1 parent 05b222e commit 5609cb2
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/main/java/pdd/vm/mw/MwBin.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,17 @@ public HashMap<String, byte[]> convert(List<ClassData> classes) throws IOExcepti
}

for (ClassData.MethodData method : cls.methods) {
if (method.code != null) {
MethodVisitor mv = cw.visitMethod(method.accessFlags, method.name, method.desc, null, null);

for (Map.Entry<String, Map<String, Object>> entry : method.annotations.entrySet()) {
final AnnotationVisitor av = mv.visitAnnotation(entry.getKey(), true);
for (Map.Entry<String, Object> annEntry : entry.getValue().entrySet()) {
visitAnnotation(av, annEntry.getKey(), annEntry.getValue());
}
av.visitEnd();
MethodVisitor mv = cw.visitMethod(method.accessFlags, method.name, method.desc, null, null);

for (Map.Entry<String, Map<String, Object>> entry : method.annotations.entrySet()) {
final AnnotationVisitor av = mv.visitAnnotation(entry.getKey(), true);
for (Map.Entry<String, Object> annEntry : entry.getValue().entrySet()) {
visitAnnotation(av, annEntry.getKey(), annEntry.getValue());
}
av.visitEnd();
}

if (method.code != null) {
MwCode.parseCode(method.code, constPool, fieldRefTypeSet, mv);
}
}
Expand Down Expand Up @@ -228,7 +228,6 @@ private static Map<String, byte[]> readSign(InputStream input, int version) thro
}



public static void toClassesJar(File inFile, File dest) throws IOException {
if (!inFile.exists()) {
throw new FileNotFoundException(inFile.getAbsolutePath());
Expand Down

0 comments on commit 5609cb2

Please sign in to comment.