diff --git a/src/main/java/net/fabricmc/tinyremapper/extension/mixin/soft/data/MemberInfo.java b/src/main/java/net/fabricmc/tinyremapper/extension/mixin/soft/data/MemberInfo.java index d4f9a87e..992e1f25 100644 --- a/src/main/java/net/fabricmc/tinyremapper/extension/mixin/soft/data/MemberInfo.java +++ b/src/main/java/net/fabricmc/tinyremapper/extension/mixin/soft/data/MemberInfo.java @@ -129,8 +129,26 @@ public static MemberInfo parse(String str) { @Override public String toString() { String owner = getOwner().isEmpty() ? "" : StringUtility.classNameToDesc(getOwner()); - String desc = getDesc().isEmpty() ? "" : (Objects.equals(getType(), MemberType.FIELD) ? ":" : "") + getDesc(); - return owner + name + quantifier + desc; + return owner + name + quantifier + formattedDesc(); + } + + private String formattedDesc() { + final String desc = getDesc(); + + if (desc.isEmpty()) { + return ""; + } + + if (Objects.equals(getType(), MemberType.FIELD)) { + return ":" + desc; + } + + // Wildcards match regardless of descriptor + if (getQuantifier().equals("*")) { + return ""; + } + + return desc; } } diff --git a/src/test/java/net/fabricmc/tinyremapper/extension/mixin/soft/data/MemberInfoTest.java b/src/test/java/net/fabricmc/tinyremapper/extension/mixin/soft/data/MemberInfoTest.java index 68a6cea1..18f97a56 100644 --- a/src/test/java/net/fabricmc/tinyremapper/extension/mixin/soft/data/MemberInfoTest.java +++ b/src/test/java/net/fabricmc/tinyremapper/extension/mixin/soft/data/MemberInfoTest.java @@ -98,5 +98,23 @@ void parse() { assertEquals(info.getQuantifier(), ""); assertEquals(info.getDesc(), "([C)Ljava/lang/String;"); assertEquals(info.toString(), "([C)Ljava/lang/String;"); + + info = MemberInfo.parse("*"); + assertNotNull(info); + assertNull(info.getType()); + assertEquals(info.getOwner(), ""); + assertEquals(info.getName(), ""); + assertEquals(info.getQuantifier(), "*"); + assertEquals(info.getDesc(), ""); + assertEquals(info.toString(), "*"); + + info = new MemberInfo("", "", "*", "()V"); + assertNotNull(info); + assertEquals(info.getType(), MemberType.METHOD); + assertEquals(info.getOwner(), ""); + assertEquals(info.getName(), ""); + assertEquals(info.getQuantifier(), "*"); + assertEquals(info.getDesc(), "()V"); + assertEquals(info.toString(), "*"); } }