Skip to content

Commit c0acf94

Browse files
committed
Support resizing of element metadata
1 parent ab1f0b5 commit c0acf94

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: src/main/java/net/fabricmc/mappingio/tree/MemoryMappingTree.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ private Entry<?> getCurrentEntry(MappedElementKind targetKind) {
702702
entry = currentEntry;
703703
}
704704

705-
if (entry == null) throw new UnsupportedOperationException("Tried to visit comment before owning target");
705+
if (entry == null) throw new UnsupportedOperationException("Tried to visit element content before owning target");
706706
return entry;
707707
}
708708

@@ -745,6 +745,10 @@ public void setDstName(String name, int namespace) {
745745

746746
void resizeDstNames(int newSize) {
747747
dstNames = Arrays.copyOf(dstNames, newSize);
748+
749+
for (Map.Entry<String, String[]> entry : metadata.entrySet()) {
750+
entry.setValue(Arrays.copyOf(entry.getValue(), newSize));
751+
}
748752
}
749753

750754
void updateDstNames(int[] map) {

0 commit comments

Comments
 (0)