From 3bc4d8e840282d30e7c3224f7a2fdd2ae51a739e Mon Sep 17 00:00:00 2001 From: NebelNidas <48808497+NebelNidas@users.noreply.github.com> Date: Thu, 29 Aug 2024 14:23:06 +0200 Subject: [PATCH] Remove ASM dependency from the core project (#110) --- CHANGELOG.md | 1 + build.gradle | 1 - .../format/proguard/ProGuardFileWriter.java | 34 +++++++++++++++---- .../net/fabricmc/mappingio/TestHelper.java | 20 ++++++++--- .../fabricmc/mappingio/write/WriteTest.java | 21 ++++++++---- .../read/repeated-elements/enigma.mappings | 4 +-- .../resources/read/repeated-elements/jam.jam | 4 +-- .../read/repeated-elements/jobf.jobf | 4 +-- .../read/repeated-elements/proguard.txt | 4 +-- .../read/repeated-elements/recaf-simple.txt | 4 +-- .../read/repeated-elements/tiny.tiny | 4 +-- .../read/repeated-elements/tinyV2.tiny | 4 +-- .../read/repeated-elements/tsrgV2.tsrg | 4 +-- .../read/repeated-elements/xsrg.xsrg | 4 +-- .../resources/read/valid-with-holes/csrg.csrg | 12 +++---- .../enigma-dir/class_32.mapping | 20 +++++------ .../read/valid-with-holes/enigma.mappings | 20 +++++------ .../resources/read/valid-with-holes/jam.jam | 10 +++--- .../resources/read/valid-with-holes/jobf.jobf | 6 ++-- .../read/valid-with-holes/proguard.txt | 6 ++-- .../read/valid-with-holes/recaf-simple.txt | 6 ++-- .../resources/read/valid-with-holes/srg.srg | 4 +-- .../resources/read/valid-with-holes/tiny.tiny | 12 +++---- .../read/valid-with-holes/tinyV2.tiny | 20 +++++------ .../resources/read/valid-with-holes/tsrg.tsrg | 12 +++---- .../read/valid-with-holes/tsrgV2.tsrg | 20 +++++------ .../resources/read/valid-with-holes/xsrg.xsrg | 6 ++-- .../valid/enigma-dir/class1Ns0Rename.mapping | 2 +- src/test/resources/read/valid/enigma.mappings | 2 +- src/test/resources/read/valid/jam.jam | 2 +- src/test/resources/read/valid/jobf.jobf | 2 +- src/test/resources/read/valid/proguard.txt | 2 +- .../resources/read/valid/recaf-simple.txt | 2 +- src/test/resources/read/valid/tiny.tiny | 2 +- src/test/resources/read/valid/tinyV2.tiny | 2 +- src/test/resources/read/valid/tsrgV2.tsrg | 2 +- src/test/resources/read/valid/xsrg.xsrg | 2 +- 37 files changed, 164 insertions(+), 123 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 733a28be..23a6c6f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added missing `visitElementContent` calls to CSRG and Recaf Simple readers - Fixed member mapping merging via tree-API in `MemoryMappingTree` - Fixed duplicate mapping definitions not being handled correctly in multiple readers +- Removed ASM dependency from core project ## [0.6.1] - 2024-04-15 - Fixed CSRG and JAM writers sometimes skipping elements whose parents have incomplete destination names diff --git a/build.gradle b/build.gradle index 7fec4885..5930f9c8 100644 --- a/build.gradle +++ b/build.gradle @@ -30,7 +30,6 @@ allprojects { } dependencies { - implementation "org.ow2.asm:asm:${project.asm_version}" compileOnly "org.jetbrains:annotations:${project.jetbrains_annotations_version}" testImplementation "net.neoforged:srgutils:${srgutils_version}" diff --git a/src/main/java/net/fabricmc/mappingio/format/proguard/ProGuardFileWriter.java b/src/main/java/net/fabricmc/mappingio/format/proguard/ProGuardFileWriter.java index 68bc8108..ef024410 100644 --- a/src/main/java/net/fabricmc/mappingio/format/proguard/ProGuardFileWriter.java +++ b/src/main/java/net/fabricmc/mappingio/format/proguard/ProGuardFileWriter.java @@ -18,11 +18,11 @@ import java.io.IOException; import java.io.Writer; +import java.util.ArrayList; import java.util.List; import java.util.Objects; import org.jetbrains.annotations.Nullable; -import org.objectweb.asm.Type; import net.fabricmc.mappingio.MappedElementKind; import net.fabricmc.mappingio.MappingWriter; @@ -157,20 +157,19 @@ public boolean visitElementContent(MappedElementKind targetKind) throws IOExcept writer.write(srcName); break; case METHOD: - Type type = Type.getMethodType(srcDesc); writeIndent(); - writer.write(toJavaType(type.getReturnType().getDescriptor())); + writer.write(toJavaType(srcDesc.substring(srcDesc.indexOf(')', 1) + 1))); writer.write(' '); writer.write(srcName); writer.write('('); - Type[] args = type.getArgumentTypes(); + List argTypes = extractArgumentTypes(srcDesc); - for (int i = 0; i < args.length; i++) { + for (int i = 0; i < argTypes.size(); i++) { if (i > 0) { writer.write(','); } - writer.write(toJavaType(args[i].getDescriptor())); + writer.write(argTypes.get(i)); } writer.write(')'); @@ -251,4 +250,27 @@ private static String toJavaType(String descriptor) { return result.toString(); } + + private List extractArgumentTypes(String desc) { + List argTypes = new ArrayList<>(); + int index = 1; // First char is always '(' + + while (desc.charAt(index) != ')') { + int start = index; + + while (desc.charAt(index) == '[') { + index++; + } + + if (desc.charAt(index) == 'L') { + index = desc.indexOf(';', index) + 1; + } else { + index++; + } + + argTypes.add(toJavaType(desc.substring(start, index))); + } + + return argTypes; + } } diff --git a/src/test/java/net/fabricmc/mappingio/TestHelper.java b/src/test/java/net/fabricmc/mappingio/TestHelper.java index 69bf4839..8e6b1432 100644 --- a/src/test/java/net/fabricmc/mappingio/TestHelper.java +++ b/src/test/java/net/fabricmc/mappingio/TestHelper.java @@ -21,6 +21,7 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.Arrays; +import java.util.List; import java.util.concurrent.atomic.AtomicInteger; import net.neoforged.srgutils.IMappingFile; @@ -259,7 +260,7 @@ private static void visitInnerClass(MemoryMappingTree tree, int nestLevel, int.. } private static void visitField(MemoryMappingTree tree, int... dstNs) { - tree.visitField(nameGen.src(fldKind), fldDesc); + tree.visitField(nameGen.src(fldKind), nameGen.desc(fldKind)); for (int ns : dstNs) { tree.visitDstName(fldKind, ns, nameGen.dst(fldKind, ns)); @@ -267,7 +268,7 @@ private static void visitField(MemoryMappingTree tree, int... dstNs) { } private static void visitMethod(MemoryMappingTree tree, int... dstNs) { - tree.visitMethod(nameGen.src(mthKind), mthDesc); + tree.visitMethod(nameGen.src(mthKind), nameGen.desc(mthKind)); for (int ns : dstNs) { tree.visitDstName(mthKind, ns, nameGen.dst(mthKind, ns)); @@ -373,6 +374,17 @@ public String dst(MappedElementKind kind, int ns) { return sb.toString(); } + public String desc(MappedElementKind kind) { + switch (kind) { + case FIELD: + return fldDescs.get((fldNum.get().get() - 1) % fldDescs.size()); + case METHOD: + return mthDescs.get((mthNum.get().get() - 1) % mthDescs.size()); + default: + throw new IllegalArgumentException("Invalid kind: " + kind); + } + } + public AtomicInteger getCounter() { return counter.get(); } @@ -442,8 +454,8 @@ public static MemoryMappingTree getCorrespondingTree(Path dir) { public static final Path REPEATED_ELEMENTS = getResource("/read/repeated-elements/"); } - private static final String fldDesc = "I"; - private static final String mthDesc = "()I"; + private static final List fldDescs = Arrays.asList("I", "Lcls;", "Lpkg/cls;", "[I"); + private static final List mthDescs = Arrays.asList("()I", "(I)V", "(Lcls;)Lcls;", "(ILcls;)Lpkg/cls;", "(Lcls;[I)[[B"); private static final String comment = "This is a comment"; private static final NameGen nameGen = new NameGen(); private static final MappedElementKind clsKind = MappedElementKind.CLASS; diff --git a/src/test/java/net/fabricmc/mappingio/write/WriteTest.java b/src/test/java/net/fabricmc/mappingio/write/WriteTest.java index 50c8eeed..7a0c1e7f 100644 --- a/src/test/java/net/fabricmc/mappingio/write/WriteTest.java +++ b/src/test/java/net/fabricmc/mappingio/write/WriteTest.java @@ -158,15 +158,22 @@ private void readWithSrgUtils(MappingTreeView tree, MappingFormat format, Map class1Ns0Rename: int method_1() -> method1Ns0Rename class_1$class_2 -> class1Ns0Rename$class2Ns0Rename0: class_1$class_2 -> class1Ns0Rename$class2Ns0Rename: - int field_2 -> field2Ns0Rename0 - int field_2 -> field2Ns0Rename + cls field_2 -> field2Ns0Rename0 + cls field_2 -> field2Ns0Rename class_3 -> class3Ns0Rename0: class_3 -> class3Ns0Rename: diff --git a/src/test/resources/read/repeated-elements/recaf-simple.txt b/src/test/resources/read/repeated-elements/recaf-simple.txt index 1c50114d..66eb1f2c 100644 --- a/src/test/resources/read/repeated-elements/recaf-simple.txt +++ b/src/test/resources/read/repeated-elements/recaf-simple.txt @@ -6,7 +6,7 @@ class_1.method_1()I method1Ns0Rename0 class_1.method_1()I method1Ns0Rename class_1$class_2 class1Ns0Rename$class2Ns0Rename0 class_1$class_2 class1Ns0Rename$class2Ns0Rename -class_1$class_2.field_2 I field2Ns0Rename0 -class_1$class_2.field_2 I field2Ns0Rename +class_1$class_2.field_2 Lcls; field2Ns0Rename0 +class_1$class_2.field_2 Lcls; field2Ns0Rename class_3 class3Ns0Rename0 class_3 class3Ns0Rename diff --git a/src/test/resources/read/repeated-elements/tiny.tiny b/src/test/resources/read/repeated-elements/tiny.tiny index 196bd3d7..094c5027 100644 --- a/src/test/resources/read/repeated-elements/tiny.tiny +++ b/src/test/resources/read/repeated-elements/tiny.tiny @@ -7,7 +7,7 @@ METHOD class_1 ()I method_1 method1Ns0Rename0 method1Ns1Rename0 METHOD class_1 ()I method_1 method1Ns0Rename method1Ns1Rename CLASS class_1$class_2 class1Ns0Rename$class2Ns0Rename0 class1Ns1Rename$class2Ns1Rename0 CLASS class_1$class_2 class1Ns0Rename$class2Ns0Rename class1Ns1Rename$class2Ns1Rename -FIELD class_1$class_2 I field_2 field2Ns0Rename0 field2Ns1Rename0 -FIELD class_1$class_2 I field_2 field2Ns0Rename field2Ns1Rename +FIELD class_1$class_2 Lcls; field_2 field2Ns0Rename0 field2Ns1Rename0 +FIELD class_1$class_2 Lcls; field_2 field2Ns0Rename field2Ns1Rename CLASS class_3 class3Ns0Rename0 class3Ns1Rename0 CLASS class_3 class3Ns0Rename class3Ns1Rename diff --git a/src/test/resources/read/repeated-elements/tinyV2.tiny b/src/test/resources/read/repeated-elements/tinyV2.tiny index 01be3216..a8636c70 100644 --- a/src/test/resources/read/repeated-elements/tinyV2.tiny +++ b/src/test/resources/read/repeated-elements/tinyV2.tiny @@ -13,7 +13,7 @@ c class_1$class_2 class1Ns0Rename$class2Ns0Rename0 class1Ns1Rename$class2Ns1Rena c class_1$class_2 class1Ns0Rename$class2Ns0Rename class1Ns1Rename$class2Ns1Rename c This is a comment. c This is a comment - f I field_2 field2Ns0Rename0 field2Ns1Rename0 - f I field_2 field2Ns0Rename field2Ns1Rename + f Lcls; field_2 field2Ns0Rename0 field2Ns1Rename0 + f Lcls; field_2 field2Ns0Rename field2Ns1Rename c class_3 class3Ns0Rename0 class3Ns1Rename0 c class_3 class3Ns0Rename class3Ns1Rename diff --git a/src/test/resources/read/repeated-elements/tsrgV2.tsrg b/src/test/resources/read/repeated-elements/tsrgV2.tsrg index 8cfa6b7f..1afc0169 100644 --- a/src/test/resources/read/repeated-elements/tsrgV2.tsrg +++ b/src/test/resources/read/repeated-elements/tsrgV2.tsrg @@ -9,7 +9,7 @@ class_1 class1Ns0Rename class1Ns1Rename 1 param_1 param1Ns0Rename param1Ns1Rename class_1$class_2 class1Ns0Rename$class2Ns0Rename0 class1Ns1Rename$class2Ns1Rename0 class_1$class_2 class1Ns0Rename$class2Ns0Rename class1Ns1Rename$class2Ns1Rename - field_2 I field2Ns0Rename0 field2Ns1Rename0 - field_2 I field2Ns0Rename field2Ns1Rename + field_2 Lcls; field2Ns0Rename0 field2Ns1Rename0 + field_2 Lcls; field2Ns0Rename field2Ns1Rename class_3 class3Ns0Rename0 class3Ns1Rename0 class_3 class3Ns0Rename class3Ns1Rename diff --git a/src/test/resources/read/repeated-elements/xsrg.xsrg b/src/test/resources/read/repeated-elements/xsrg.xsrg index 6ae2a193..30f9b5ec 100644 --- a/src/test/resources/read/repeated-elements/xsrg.xsrg +++ b/src/test/resources/read/repeated-elements/xsrg.xsrg @@ -6,7 +6,7 @@ MD: class_1/method_1 ()I class1Ns0Rename/method1Ns0Rename0 ()I MD: class_1/method_1 ()I class1Ns0Rename/method1Ns0Rename ()I CL: class_1$class_2 class1Ns0Rename$class2Ns0Rename0 CL: class_1$class_2 class1Ns0Rename$class2Ns0Rename -FD: class_1$class_2/field_2 I class1Ns0Rename$class2Ns0Rename/field2Ns0Rename0 I -FD: class_1$class_2/field_2 I class1Ns0Rename$class2Ns0Rename/field2Ns0Rename I +FD: class_1$class_2/field_2 Lcls; class1Ns0Rename$class2Ns0Rename/field2Ns0Rename0 Lcls; +FD: class_1$class_2/field_2 Lcls; class1Ns0Rename$class2Ns0Rename/field2Ns0Rename Lcls; CL: class_3 class3Ns0Rename0 CL: class_3 class3Ns0Rename diff --git a/src/test/resources/read/valid-with-holes/csrg.csrg b/src/test/resources/read/valid-with-holes/csrg.csrg index c16d137c..ef91ca84 100644 --- a/src/test/resources/read/valid-with-holes/csrg.csrg +++ b/src/test/resources/read/valid-with-holes/csrg.csrg @@ -24,10 +24,10 @@ class_32 field_4 field_4 class_32 field_5 field5Ns0Rename class_32 field_6 field_6 class_32 method_1 ()I method_1 -class_32 method_2 ()I method2Ns0Rename -class_32 method_3 ()I method_3 -class_32 method_4 ()I method_4 -class_32 method_5 ()I method5Ns0Rename +class_32 method_2 (I)V method2Ns0Rename +class_32 method_3 (Lcls;)Lcls; method_3 +class_32 method_4 (ILcls;)Lpkg/cls; method_4 +class_32 method_5 (Lcls;[I)[[B method5Ns0Rename class_32 method_6 ()I method_6 -class_32 method_7 ()I method_7 -class_32 method_8 ()I method_8 +class_32 method_7 (I)V method_7 +class_32 method_8 (Lcls;)Lcls; method_8 diff --git a/src/test/resources/read/valid-with-holes/enigma-dir/class_32.mapping b/src/test/resources/read/valid-with-holes/enigma-dir/class_32.mapping index 6a269a1e..22bad68e 100644 --- a/src/test/resources/read/valid-with-holes/enigma-dir/class_32.mapping +++ b/src/test/resources/read/valid-with-holes/enigma-dir/class_32.mapping @@ -1,23 +1,23 @@ CLASS class_32 FIELD field_1 I - FIELD field_2 field2Ns0Rename I - FIELD field_3 I - FIELD field_4 I + FIELD field_2 field2Ns0Rename Lcls; + FIELD field_3 Lpkg/cls; + FIELD field_4 [I COMMENT This is a comment FIELD field_5 field5Ns0Rename I COMMENT This is a comment - FIELD field_6 I + FIELD field_6 Lcls; COMMENT This is a comment METHOD method_1 ()I - METHOD method_2 method2Ns0Rename ()I - METHOD method_3 ()I - METHOD method_4 ()I + METHOD method_2 method2Ns0Rename (I)V + METHOD method_3 (Lcls;)Lcls; + METHOD method_4 (ILcls;)Lpkg/cls; COMMENT This is a comment - METHOD method_5 method5Ns0Rename ()I + METHOD method_5 method5Ns0Rename (Lcls;[I)[[B COMMENT This is a comment METHOD method_6 ()I COMMENT This is a comment - METHOD method_7 ()I + METHOD method_7 (I)V ARG 1 ARG 3 ARG 5 param3Ns0Rename @@ -27,4 +27,4 @@ CLASS class_32 COMMENT This is a comment ARG 11 COMMENT This is a comment - METHOD method_8 ()I + METHOD method_8 (Lcls;)Lcls; diff --git a/src/test/resources/read/valid-with-holes/enigma.mappings b/src/test/resources/read/valid-with-holes/enigma.mappings index f40fb44f..cadb3347 100644 --- a/src/test/resources/read/valid-with-holes/enigma.mappings +++ b/src/test/resources/read/valid-with-holes/enigma.mappings @@ -40,24 +40,24 @@ CLASS class_29 COMMENT This is a comment CLASS class_32 FIELD field_1 I - FIELD field_2 field2Ns0Rename I - FIELD field_3 I - FIELD field_4 I + FIELD field_2 field2Ns0Rename Lcls; + FIELD field_3 Lpkg/cls; + FIELD field_4 [I COMMENT This is a comment FIELD field_5 field5Ns0Rename I COMMENT This is a comment - FIELD field_6 I + FIELD field_6 Lcls; COMMENT This is a comment METHOD method_1 ()I - METHOD method_2 method2Ns0Rename ()I - METHOD method_3 ()I - METHOD method_4 ()I + METHOD method_2 method2Ns0Rename (I)V + METHOD method_3 (Lcls;)Lcls; + METHOD method_4 (ILcls;)Lpkg/cls; COMMENT This is a comment - METHOD method_5 method5Ns0Rename ()I + METHOD method_5 method5Ns0Rename (Lcls;[I)[[B COMMENT This is a comment METHOD method_6 ()I COMMENT This is a comment - METHOD method_7 ()I + METHOD method_7 (I)V ARG 1 ARG 3 ARG 5 param3Ns0Rename @@ -67,4 +67,4 @@ CLASS class_32 COMMENT This is a comment ARG 11 COMMENT This is a comment - METHOD method_8 ()I + METHOD method_8 (Lcls;)Lcls; diff --git a/src/test/resources/read/valid-with-holes/jam.jam b/src/test/resources/read/valid-with-holes/jam.jam index 47c37514..d0ab1993 100644 --- a/src/test/resources/read/valid-with-holes/jam.jam +++ b/src/test/resources/read/valid-with-holes/jam.jam @@ -4,9 +4,9 @@ CL class_7$class_8 class_7$class8Ns0Rename CL class_13$class_14 class_13$class14Ns0Rename CL class_17$class_18$class_19 class_17$class_18$class19Ns0Rename CL class_26$class_27$class_28 class_26$class_27$class28Ns0Rename -FD class_32 field_2 I field2Ns0Rename +FD class_32 field_2 Lcls; field2Ns0Rename FD class_32 field_5 I field5Ns0Rename -MD class_32 method_2 ()I method2Ns0Rename -MD class_32 method_5 ()I method5Ns0Rename -MP class_32 method_7 ()I 4 param3Ns0Rename -MP class_32 method_7 ()I 8 param5Ns0Rename +MD class_32 method_2 (I)V method2Ns0Rename +MD class_32 method_5 (Lcls;[I)[[B method5Ns0Rename +MP class_32 method_7 (I)V 4 param3Ns0Rename +MP class_32 method_7 (I)V 8 param5Ns0Rename diff --git a/src/test/resources/read/valid-with-holes/jobf.jobf b/src/test/resources/read/valid-with-holes/jobf.jobf index 9825b88d..8f8bddba 100644 --- a/src/test/resources/read/valid-with-holes/jobf.jobf +++ b/src/test/resources/read/valid-with-holes/jobf.jobf @@ -4,7 +4,7 @@ c class_7$class_8 = class_7$class8Ns0Rename c class_13$class_14 = class_13$class14Ns0Rename c class_17$class_18$class_19 = class_17$class_18$class19Ns0Rename c class_26$class_27$class_28 = class_26$class_27$class28Ns0Rename -f class_32.field_2:I = field2Ns0Rename +f class_32.field_2:Lcls; = field2Ns0Rename f class_32.field_5:I = field5Ns0Rename -m class_32.method_2()I = method2Ns0Rename -m class_32.method_5()I = method5Ns0Rename +m class_32.method_2(I)V = method2Ns0Rename +m class_32.method_5(Lcls;[I)[[B = method5Ns0Rename diff --git a/src/test/resources/read/valid-with-holes/proguard.txt b/src/test/resources/read/valid-with-holes/proguard.txt index 6af51f4b..43a93f1f 100644 --- a/src/test/resources/read/valid-with-holes/proguard.txt +++ b/src/test/resources/read/valid-with-holes/proguard.txt @@ -5,7 +5,7 @@ class_13$class_14 -> class_13$class14Ns0Rename: class_17$class_18$class_19 -> class_17$class_18$class19Ns0Rename: class_26$class_27$class_28 -> class_26$class_27$class28Ns0Rename: class_32 -> class_32: - int field_2 -> field2Ns0Rename + cls field_2 -> field2Ns0Rename int field_5 -> field5Ns0Rename - int method_2() -> method2Ns0Rename - int method_5() -> method5Ns0Rename + void method_2(int) -> method2Ns0Rename + byte[][] method_5(cls,int[]) -> method5Ns0Rename diff --git a/src/test/resources/read/valid-with-holes/recaf-simple.txt b/src/test/resources/read/valid-with-holes/recaf-simple.txt index 03d02a35..fe62486c 100644 --- a/src/test/resources/read/valid-with-holes/recaf-simple.txt +++ b/src/test/resources/read/valid-with-holes/recaf-simple.txt @@ -4,7 +4,7 @@ class_7$class_8 class_7$class8Ns0Rename class_13$class_14 class_13$class14Ns0Rename class_17$class_18$class_19 class_17$class_18$class19Ns0Rename class_26$class_27$class_28 class_26$class_27$class28Ns0Rename -class_32.field_2 I field2Ns0Rename +class_32.field_2 Lcls; field2Ns0Rename class_32.field_5 I field5Ns0Rename -class_32.method_2()I method2Ns0Rename -class_32.method_5()I method5Ns0Rename +class_32.method_2(I)V method2Ns0Rename +class_32.method_5(Lcls;[I)[[B method5Ns0Rename diff --git a/src/test/resources/read/valid-with-holes/srg.srg b/src/test/resources/read/valid-with-holes/srg.srg index e2972aea..a9196282 100644 --- a/src/test/resources/read/valid-with-holes/srg.srg +++ b/src/test/resources/read/valid-with-holes/srg.srg @@ -6,5 +6,5 @@ CL: class_17$class_18$class_19 class_17$class_18$class19Ns0Rename CL: class_26$class_27$class_28 class_26$class_27$class28Ns0Rename FD: class_32/field_2 class_32/field2Ns0Rename FD: class_32/field_5 class_32/field5Ns0Rename -MD: class_32/method_2 ()I class_32/method2Ns0Rename ()I -MD: class_32/method_5 ()I class_32/method5Ns0Rename ()I +MD: class_32/method_2 (I)V class_32/method2Ns0Rename (I)V +MD: class_32/method_5 (Lcls;[I)[[B class_32/method5Ns0Rename (Lcls;[I)[[B diff --git a/src/test/resources/read/valid-with-holes/tiny.tiny b/src/test/resources/read/valid-with-holes/tiny.tiny index 42e295f1..a10a02ab 100644 --- a/src/test/resources/read/valid-with-holes/tiny.tiny +++ b/src/test/resources/read/valid-with-holes/tiny.tiny @@ -11,11 +11,11 @@ CLASS class_17$class_18$class_19 class_17$class_18$class19Ns0Rename CLASS class_20$class_21$class_22 class_20$class_21$class22Ns1Rename CLASS class_26$class_27$class_28 class_26$class_27$class28Ns0Rename CLASS class_29$class_30$class_31 class_29$class_30$class31Ns1Rename -FIELD class_32 I field_2 field2Ns0Rename -FIELD class_32 I field_3 field3Ns1Rename +FIELD class_32 Lcls; field_2 field2Ns0Rename +FIELD class_32 Lpkg/cls; field_3 field3Ns1Rename FIELD class_32 I field_5 field5Ns0Rename -FIELD class_32 I field_6 field6Ns1Rename -METHOD class_32 ()I method_2 method2Ns0Rename -METHOD class_32 ()I method_3 method3Ns1Rename -METHOD class_32 ()I method_5 method5Ns0Rename +FIELD class_32 Lcls; field_6 field6Ns1Rename +METHOD class_32 (I)V method_2 method2Ns0Rename +METHOD class_32 (Lcls;)Lcls; method_3 method3Ns1Rename +METHOD class_32 (Lcls;[I)[[B method_5 method5Ns0Rename METHOD class_32 ()I method_6 method6Ns1Rename diff --git a/src/test/resources/read/valid-with-holes/tinyV2.tiny b/src/test/resources/read/valid-with-holes/tinyV2.tiny index bc6c49fe..7362d517 100644 --- a/src/test/resources/read/valid-with-holes/tinyV2.tiny +++ b/src/test/resources/read/valid-with-holes/tinyV2.tiny @@ -28,24 +28,24 @@ c class_29$class_30$class_31 class_29$class_30$class31Ns1Rename c This is a comment c class_32 f I field_1 - f I field_2 field2Ns0Rename - f I field_3 field3Ns1Rename - f I field_4 + f Lcls; field_2 field2Ns0Rename + f Lpkg/cls; field_3 field3Ns1Rename + f [I field_4 c This is a comment f I field_5 field5Ns0Rename c This is a comment - f I field_6 field6Ns1Rename + f Lcls; field_6 field6Ns1Rename c This is a comment m ()I method_1 - m ()I method_2 method2Ns0Rename - m ()I method_3 method3Ns1Rename - m ()I method_4 + m (I)V method_2 method2Ns0Rename + m (Lcls;)Lcls; method_3 method3Ns1Rename + m (ILcls;)Lpkg/cls; method_4 c This is a comment - m ()I method_5 method5Ns0Rename + m (Lcls;[I)[[B method_5 method5Ns0Rename c This is a comment m ()I method_6 method6Ns1Rename c This is a comment - m ()I method_7 + m (I)V method_7 p 1 param_1 p 3 param_2 param2Ns1Rename p 5 param_3 param3Ns0Rename @@ -55,7 +55,7 @@ c class_32 c This is a comment p 11 param_6 param6Ns1Rename c This is a comment - m ()I method_8 + m (Lcls;)Lcls; method_8 v 12 12 12 var_1 v 14 14 14 var_2 var2Ns1Rename v 16 16 16 var_3 var3Ns0Rename diff --git a/src/test/resources/read/valid-with-holes/tsrg.tsrg b/src/test/resources/read/valid-with-holes/tsrg.tsrg index 0763bf69..09667011 100644 --- a/src/test/resources/read/valid-with-holes/tsrg.tsrg +++ b/src/test/resources/read/valid-with-holes/tsrg.tsrg @@ -24,10 +24,10 @@ class_32 class_32 field_5 field5Ns0Rename field_6 field_6 method_1 ()I method_1 - method_2 ()I method2Ns0Rename - method_3 ()I method_3 - method_4 ()I method_4 - method_5 ()I method5Ns0Rename + method_2 (I)V method2Ns0Rename + method_3 (Lcls;)Lcls; method_3 + method_4 (ILcls;)Lpkg/cls; method_4 + method_5 (Lcls;[I)[[B method5Ns0Rename method_6 ()I method_6 - method_7 ()I method_7 - method_8 ()I method_8 + method_7 (I)V method_7 + method_8 (Lcls;)Lcls; method_8 diff --git a/src/test/resources/read/valid-with-holes/tsrgV2.tsrg b/src/test/resources/read/valid-with-holes/tsrgV2.tsrg index 3fd2de0e..3749147c 100644 --- a/src/test/resources/read/valid-with-holes/tsrgV2.tsrg +++ b/src/test/resources/read/valid-with-holes/tsrgV2.tsrg @@ -19,22 +19,22 @@ class_26$class_27$class_28 class_26$class_27$class28Ns0Rename class_26$class_27$ class_29$class_30$class_31 class_29$class_30$class_31 class_29$class_30$class31Ns1Rename class_32 class_32 class_32 field_1 I field_1 field_1 - field_2 I field2Ns0Rename field_2 - field_3 I field_3 field3Ns1Rename - field_4 I field_4 field_4 + field_2 Lcls; field2Ns0Rename field_2 + field_3 Lpkg/cls; field_3 field3Ns1Rename + field_4 [I field_4 field_4 field_5 I field5Ns0Rename field_5 - field_6 I field_6 field6Ns1Rename + field_6 Lcls; field_6 field6Ns1Rename method_1 ()I method_1 method_1 - method_2 ()I method2Ns0Rename method_2 - method_3 ()I method_3 method3Ns1Rename - method_4 ()I method_4 method_4 - method_5 ()I method5Ns0Rename method_5 + method_2 (I)V method2Ns0Rename method_2 + method_3 (Lcls;)Lcls; method_3 method3Ns1Rename + method_4 (ILcls;)Lpkg/cls; method_4 method_4 + method_5 (Lcls;[I)[[B method5Ns0Rename method_5 method_6 ()I method_6 method6Ns1Rename - method_7 ()I method_7 method_7 + method_7 (I)V method_7 method_7 1 param_1 param_1 param_1 3 param_2 param_2 param2Ns1Rename 5 param_3 param3Ns0Rename param_3 7 param_4 param_4 param_4 9 param_5 param5Ns0Rename param_5 11 param_6 param_6 param6Ns1Rename - method_8 ()I method_8 method_8 + method_8 (Lcls;)Lcls; method_8 method_8 diff --git a/src/test/resources/read/valid-with-holes/xsrg.xsrg b/src/test/resources/read/valid-with-holes/xsrg.xsrg index e08233de..0cb4a99f 100644 --- a/src/test/resources/read/valid-with-holes/xsrg.xsrg +++ b/src/test/resources/read/valid-with-holes/xsrg.xsrg @@ -4,7 +4,7 @@ CL: class_7$class_8 class_7$class8Ns0Rename CL: class_13$class_14 class_13$class14Ns0Rename CL: class_17$class_18$class_19 class_17$class_18$class19Ns0Rename CL: class_26$class_27$class_28 class_26$class_27$class28Ns0Rename -FD: class_32/field_2 I class_32/field2Ns0Rename I +FD: class_32/field_2 Lcls; class_32/field2Ns0Rename I FD: class_32/field_5 I class_32/field5Ns0Rename I -MD: class_32/method_2 ()I class_32/method2Ns0Rename ()I -MD: class_32/method_5 ()I class_32/method5Ns0Rename ()I +MD: class_32/method_2 (I)V class_32/method2Ns0Rename ()I +MD: class_32/method_5 (Lcls;[I)[[B class_32/method5Ns0Rename ()I diff --git a/src/test/resources/read/valid/enigma-dir/class1Ns0Rename.mapping b/src/test/resources/read/valid/enigma-dir/class1Ns0Rename.mapping index 8a313665..37c0b3f9 100644 --- a/src/test/resources/read/valid/enigma-dir/class1Ns0Rename.mapping +++ b/src/test/resources/read/valid/enigma-dir/class1Ns0Rename.mapping @@ -4,4 +4,4 @@ CLASS class_1 class1Ns0Rename ARG 1 param1Ns0Rename CLASS class_2 class2Ns0Rename COMMENT This is a comment - FIELD field_2 field2Ns0Rename I + FIELD field_2 field2Ns0Rename Lcls; diff --git a/src/test/resources/read/valid/enigma.mappings b/src/test/resources/read/valid/enigma.mappings index 05963c4a..9f0e4f49 100644 --- a/src/test/resources/read/valid/enigma.mappings +++ b/src/test/resources/read/valid/enigma.mappings @@ -4,5 +4,5 @@ CLASS class_1 class1Ns0Rename ARG 1 param1Ns0Rename CLASS class_2 class2Ns0Rename COMMENT This is a comment - FIELD field_2 field2Ns0Rename I + FIELD field_2 field2Ns0Rename Lcls; CLASS class_3 class3Ns0Rename diff --git a/src/test/resources/read/valid/jam.jam b/src/test/resources/read/valid/jam.jam index 64972fd5..39f38b73 100644 --- a/src/test/resources/read/valid/jam.jam +++ b/src/test/resources/read/valid/jam.jam @@ -4,4 +4,4 @@ CL class_3 class3Ns0Rename FD class_1 field_1 I field1Ns0Rename MD class_1 method_1 ()I method1Ns0Rename MP class_1 method_1 ()I 0 param1Ns0Rename -FD class_1$class_2 field_2 I field2Ns0Rename +FD class_1$class_2 field_2 Lcls; field2Ns0Rename diff --git a/src/test/resources/read/valid/jobf.jobf b/src/test/resources/read/valid/jobf.jobf index cb332365..8a22137e 100644 --- a/src/test/resources/read/valid/jobf.jobf +++ b/src/test/resources/read/valid/jobf.jobf @@ -2,5 +2,5 @@ c class_1 = class1Ns0Rename f class_1.field_1:I = field1Ns0Rename m class_1.method_1()I = method1Ns0Rename c class_1$class_2 = class1Ns0Rename$class2Ns0Rename -f class_1$class_2.field_2:I = field2Ns0Rename +f class_1$class_2.field_2:Lcls; = field2Ns0Rename c class_3 = class3Ns0Rename diff --git a/src/test/resources/read/valid/proguard.txt b/src/test/resources/read/valid/proguard.txt index 1c64adb7..b38d5ec3 100644 --- a/src/test/resources/read/valid/proguard.txt +++ b/src/test/resources/read/valid/proguard.txt @@ -2,5 +2,5 @@ class_1 -> class1Ns0Rename: int field_1 -> field1Ns0Rename int method_1() -> method1Ns0Rename class_1$class_2 -> class1Ns0Rename$class2Ns0Rename: - int field_2 -> field2Ns0Rename + cls field_2 -> field2Ns0Rename class_3 -> class3Ns0Rename: diff --git a/src/test/resources/read/valid/recaf-simple.txt b/src/test/resources/read/valid/recaf-simple.txt index 7ca04bbf..640acd59 100644 --- a/src/test/resources/read/valid/recaf-simple.txt +++ b/src/test/resources/read/valid/recaf-simple.txt @@ -2,5 +2,5 @@ class_1 class1Ns0Rename class_1.field_1 I field1Ns0Rename class_1.method_1()I method1Ns0Rename class_1$class_2 class1Ns0Rename$class2Ns0Rename -class_1$class_2.field_2 I field2Ns0Rename +class_1$class_2.field_2 Lcls; field2Ns0Rename class_3 class3Ns0Rename diff --git a/src/test/resources/read/valid/tiny.tiny b/src/test/resources/read/valid/tiny.tiny index 6b06817e..d49bef66 100644 --- a/src/test/resources/read/valid/tiny.tiny +++ b/src/test/resources/read/valid/tiny.tiny @@ -3,5 +3,5 @@ CLASS class_1 class1Ns0Rename class1Ns1Rename FIELD class_1 I field_1 field1Ns0Rename field1Ns1Rename METHOD class_1 ()I method_1 method1Ns0Rename method1Ns1Rename CLASS class_1$class_2 class1Ns0Rename$class2Ns0Rename class1Ns1Rename$class2Ns1Rename -FIELD class_1$class_2 I field_2 field2Ns0Rename field2Ns1Rename +FIELD class_1$class_2 Lcls; field_2 field2Ns0Rename field2Ns1Rename CLASS class_3 class3Ns0Rename class3Ns1Rename diff --git a/src/test/resources/read/valid/tinyV2.tiny b/src/test/resources/read/valid/tinyV2.tiny index b8470282..c681c7d2 100644 --- a/src/test/resources/read/valid/tinyV2.tiny +++ b/src/test/resources/read/valid/tinyV2.tiny @@ -6,5 +6,5 @@ c class_1 class1Ns0Rename class1Ns1Rename v 2 2 2 var_1 var1Ns0Rename var1Ns1Rename c class_1$class_2 class1Ns0Rename$class2Ns0Rename class1Ns1Rename$class2Ns1Rename c This is a comment - f I field_2 field2Ns0Rename field2Ns1Rename + f Lcls; field_2 field2Ns0Rename field2Ns1Rename c class_3 class3Ns0Rename class3Ns1Rename diff --git a/src/test/resources/read/valid/tsrgV2.tsrg b/src/test/resources/read/valid/tsrgV2.tsrg index 293d61ae..caf0fde1 100644 --- a/src/test/resources/read/valid/tsrgV2.tsrg +++ b/src/test/resources/read/valid/tsrgV2.tsrg @@ -4,5 +4,5 @@ class_1 class1Ns0Rename class1Ns1Rename method_1 ()I method1Ns0Rename method1Ns1Rename 1 param_1 param1Ns0Rename param1Ns1Rename class_1$class_2 class1Ns0Rename$class2Ns0Rename class1Ns1Rename$class2Ns1Rename - field_2 I field2Ns0Rename field2Ns1Rename + field_2 Lcls; field2Ns0Rename field2Ns1Rename class_3 class3Ns0Rename class3Ns1Rename diff --git a/src/test/resources/read/valid/xsrg.xsrg b/src/test/resources/read/valid/xsrg.xsrg index 247c2dd7..f3fd959e 100644 --- a/src/test/resources/read/valid/xsrg.xsrg +++ b/src/test/resources/read/valid/xsrg.xsrg @@ -2,5 +2,5 @@ CL: class_1 class1Ns0Rename FD: class_1/field_1 I class1Ns0Rename/field1Ns0Rename I MD: class_1/method_1 ()I class1Ns0Rename/method1Ns0Rename ()I CL: class_1$class_2 class1Ns0Rename$class2Ns0Rename -FD: class_1$class_2/field_2 I class1Ns0Rename$class2Ns0Rename/field2Ns0Rename I +FD: class_1$class_2/field_2 Lcls; class1Ns0Rename$class2Ns0Rename/field2Ns0Rename Lcls; CL: class_3 class3Ns0Rename