From 5609cb2350eb0ce08e569009c8281a825485e50f Mon Sep 17 00:00:00 2001 From: mao Date: Wed, 15 Mar 2023 14:34:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8A=BD=E8=B1=A1=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E8=A2=AB=E4=B8=A2=E5=BC=83=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/pdd/vm/mw/MwBin.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/main/java/pdd/vm/mw/MwBin.java b/src/main/java/pdd/vm/mw/MwBin.java index 09ff81e..0b9228c 100644 --- a/src/main/java/pdd/vm/mw/MwBin.java +++ b/src/main/java/pdd/vm/mw/MwBin.java @@ -84,17 +84,17 @@ public HashMap convert(List 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> entry : method.annotations.entrySet()) { - final AnnotationVisitor av = mv.visitAnnotation(entry.getKey(), true); - for (Map.Entry 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> entry : method.annotations.entrySet()) { + final AnnotationVisitor av = mv.visitAnnotation(entry.getKey(), true); + for (Map.Entry annEntry : entry.getValue().entrySet()) { + visitAnnotation(av, annEntry.getKey(), annEntry.getValue()); } + av.visitEnd(); + } + if (method.code != null) { MwCode.parseCode(method.code, constPool, fieldRefTypeSet, mv); } } @@ -228,7 +228,6 @@ private static Map readSign(InputStream input, int version) thro } - public static void toClassesJar(File inFile, File dest) throws IOException { if (!inFile.exists()) { throw new FileNotFoundException(inFile.getAbsolutePath());