From a0c7d467f33003cf77f9676d98128bec5f2f2ea4 Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Sat, 15 Oct 2022 23:37:29 +0200 Subject: [PATCH] Update ASM to 9.4 (#23) --- jar_jar.bzl | 8 ++++---- .../com/github/johnynek/jarjar/EmptyClassVisitor.java | 8 ++++---- .../github/johnynek/jarjar/MethodSignatureProcessor.java | 4 ++-- .../java/com/github/johnynek/jarjar/StringReader.java | 8 ++++---- .../github/johnynek/jarjar/util/GetNameClassWriter.java | 2 +- .../com/github/johnynek/jarjar/MethodRewriterTest.java | 4 ++-- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/jar_jar.bzl b/jar_jar.bzl index 5642a13..a541fe0 100644 --- a/jar_jar.bzl +++ b/jar_jar.bzl @@ -24,13 +24,13 @@ def _http_jar_with_servers(name, path, sha256, servers): def jar_jar_repositories(servers=["https://repo1.maven.org/maven2"]): _http_jar_with_servers( name = "bazel_jar_jar_asm", - path = "/org/ow2/asm/asm/7.0/asm-7.0.jar", - sha256 = "b88ef66468b3c978ad0c97fd6e90979e56155b4ac69089ba7a44e9aa7ffe9acf", + path = "/org/ow2/asm/asm/9.4/asm-9.4.jar", + sha256 = "39d0e2b3dc45af65a09b097945750a94a126e052e124f93468443a1d0e15f381", servers = servers, ) _http_jar_with_servers( name = "bazel_jar_jar_asm_commons", - path = "/org/ow2/asm/asm-commons/7.0/asm-commons-7.0.jar", - sha256 = "fed348ef05958e3e846a3ac074a12af5f7936ef3d21ce44a62c4fa08a771927d", + path = "/org/ow2/asm/asm-commons/9.4/asm-commons-9.4.jar", + sha256 = "0c128a9ec3f33c98959272f6d16cf14247b508f58951574bcdbd2b56d6326364", servers = servers, ) diff --git a/src/main/java/com/github/johnynek/jarjar/EmptyClassVisitor.java b/src/main/java/com/github/johnynek/jarjar/EmptyClassVisitor.java index 96f4006..2c4511e 100644 --- a/src/main/java/com/github/johnynek/jarjar/EmptyClassVisitor.java +++ b/src/main/java/com/github/johnynek/jarjar/EmptyClassVisitor.java @@ -28,23 +28,23 @@ public class EmptyClassVisitor extends ClassVisitor { public EmptyClassVisitor() { - super(Opcodes.ASM7); + super(Opcodes.ASM9); } @Override public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { - return new MethodVisitor(Opcodes.ASM7) {}; + return new MethodVisitor(Opcodes.ASM9) {}; } @Override public AnnotationVisitor visitAnnotation(String desc, boolean visible) { - return new AnnotationVisitor(Opcodes.ASM7) {}; + return new AnnotationVisitor(Opcodes.ASM9) {}; } @Override public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) { - return new FieldVisitor(Opcodes.ASM7) {}; + return new FieldVisitor(Opcodes.ASM9) {}; } } diff --git a/src/main/java/com/github/johnynek/jarjar/MethodSignatureProcessor.java b/src/main/java/com/github/johnynek/jarjar/MethodSignatureProcessor.java index 106ca06..147077b 100644 --- a/src/main/java/com/github/johnynek/jarjar/MethodSignatureProcessor.java +++ b/src/main/java/com/github/johnynek/jarjar/MethodSignatureProcessor.java @@ -65,7 +65,7 @@ private class MethodSignatureRemapperMethodVisitor extends MethodVisitor { private boolean rewriteNextLdcInstruction = false; private MethodSignatureRemapperMethodVisitor(MethodVisitor methodVisitor) { - super(Opcodes.ASM7, methodVisitor); + super(Opcodes.ASM9, methodVisitor); } private boolean shouldMarkNextLdcForRewrite(int opcode, String name) { @@ -97,7 +97,7 @@ public void visitLdcInsn(Object value) { } public MethodSignatureRemapperClassVisitor(ClassVisitor classVisitor) { - super(Opcodes.ASM7, classVisitor); + super(Opcodes.ASM9, classVisitor); } @Override diff --git a/src/main/java/com/github/johnynek/jarjar/StringReader.java b/src/main/java/com/github/johnynek/jarjar/StringReader.java index 02ae908..e873e7e 100644 --- a/src/main/java/com/github/johnynek/jarjar/StringReader.java +++ b/src/main/java/com/github/johnynek/jarjar/StringReader.java @@ -24,7 +24,7 @@ abstract class StringReader extends ClassVisitor private String className; public StringReader() { - super(Opcodes.ASM7); + super(Opcodes.ASM9); } abstract public void visitString(String className, String value, int line); @@ -42,7 +42,7 @@ public void visit(int version, int access, String name, String signature, String public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) { handleObject(value); - return new FieldVisitor(Opcodes.ASM7){ + return new FieldVisitor(Opcodes.ASM9){ @Override public AnnotationVisitor visitAnnotation(String desc, boolean visible) { return StringReader.this.visitAnnotation(desc, visible); @@ -52,7 +52,7 @@ public AnnotationVisitor visitAnnotation(String desc, boolean visible) { @Override public AnnotationVisitor visitAnnotation(String desc, boolean visible) { - return new AnnotationVisitor(Opcodes.ASM7) { + return new AnnotationVisitor(Opcodes.ASM9) { @Override public void visit(String name, Object value) { handleObject(value); @@ -71,7 +71,7 @@ public AnnotationVisitor visitAnnotation(String name, String desc) { @Override public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { - MethodVisitor mv = new MethodVisitor(Opcodes.ASM7){ + MethodVisitor mv = new MethodVisitor(Opcodes.ASM9){ @Override public void visitLdcInsn(Object cst) { handleObject(cst); diff --git a/src/main/java/com/github/johnynek/jarjar/util/GetNameClassWriter.java b/src/main/java/com/github/johnynek/jarjar/util/GetNameClassWriter.java index 9e76857..d0bc607 100644 --- a/src/main/java/com/github/johnynek/jarjar/util/GetNameClassWriter.java +++ b/src/main/java/com/github/johnynek/jarjar/util/GetNameClassWriter.java @@ -25,7 +25,7 @@ public class GetNameClassWriter extends ClassVisitor private String className; public GetNameClassWriter(int flags) { - super(Opcodes.ASM7,new ClassWriter(flags)); + super(Opcodes.ASM9,new ClassWriter(flags)); } public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { diff --git a/src/test/java/com/github/johnynek/jarjar/MethodRewriterTest.java b/src/test/java/com/github/johnynek/jarjar/MethodRewriterTest.java index 39ebaeb..0b66502 100644 --- a/src/test/java/com/github/johnynek/jarjar/MethodRewriterTest.java +++ b/src/test/java/com/github/johnynek/jarjar/MethodRewriterTest.java @@ -19,7 +19,7 @@ private static class VerifyingClassVisitor extends ClassVisitor { private static class VerifyingMethodVisitor extends MethodVisitor { private VerifyingMethodVisitor() { - super(Opcodes.ASM7); + super(Opcodes.ASM9); } @Override @@ -32,7 +32,7 @@ public void visitLdcInsn(Object value) { } private VerifyingClassVisitor() { - super(Opcodes.ASM7); + super(Opcodes.ASM9); } @Override