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: