From acf4625f2a2628439e89a25970abe2fa7ec7cdd3 Mon Sep 17 00:00:00 2001 From: NebelNidas Date: Fri, 8 Dec 2023 00:57:57 +0100 Subject: [PATCH] Small fixes --- .../net/fabricmc/mappingio/format/srg/JamFileWriter.java | 2 +- .../net/fabricmc/mappingio/format/srg/SrgFileWriter.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/fabricmc/mappingio/format/srg/JamFileWriter.java b/src/main/java/net/fabricmc/mappingio/format/srg/JamFileWriter.java index bd6b0724..2653d9c6 100644 --- a/src/main/java/net/fabricmc/mappingio/format/srg/JamFileWriter.java +++ b/src/main/java/net/fabricmc/mappingio/format/srg/JamFileWriter.java @@ -124,7 +124,7 @@ public boolean visitElementContent(MappedElementKind targetKind) throws IOExcept || (field = targetKind == MappedElementKind.FIELD) || (arg = targetKind == MappedElementKind.METHOD_ARG)) { if (classOnlyPass || memberSrcDesc == null || memberDstName == null) { - return true; + return !field && !arg; } if (field) { diff --git a/src/main/java/net/fabricmc/mappingio/format/srg/SrgFileWriter.java b/src/main/java/net/fabricmc/mappingio/format/srg/SrgFileWriter.java index f6379a7d..b74db414 100644 --- a/src/main/java/net/fabricmc/mappingio/format/srg/SrgFileWriter.java +++ b/src/main/java/net/fabricmc/mappingio/format/srg/SrgFileWriter.java @@ -103,7 +103,7 @@ public void visitDstName(MappedElementKind targetKind, int namespace, String nam memberDstName = name; break; default: - break; + throw new IllegalStateException("unexpected invocation for "+targetKind); } } @@ -122,11 +122,11 @@ public boolean visitElementContent(MappedElementKind targetKind) throws IOExcept write("CL: "); break; case FIELD: - if (memberDstName == null) return false; + if (memberSrcDesc == null || memberDstName == null || (xsrg && memberDstDesc == null)) return false; write("FD: "); break; case METHOD: - if (memberDstName == null || memberDstDesc == null) return false; + if (memberSrcDesc == null || memberDstName == null || memberDstDesc == null) return false; write("MD: "); break; default: