Skip to content

Commit 4dcdf09

Browse files
committed
Do not convert ModFileScanData annotation values to immutable lists
Related: #627
1 parent f26d350 commit 4dcdf09

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/org/embeddedt/modernfix/forge/load/ModFileScanDataCompactor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import org.objectweb.asm.Type;
99

1010
import java.lang.reflect.Field;
11-
import java.util.List;
11+
import java.util.ArrayList;
1212
import java.util.Map;
1313
import java.util.stream.Collectors;
1414

@@ -65,8 +65,8 @@ private static void compact(ModFileScanData data, String fileName) {
6565
memberNames.addOrGet(a.memberName()),
6666
a.annotationData().entrySet().stream().collect(Collectors.toUnmodifiableMap(Map.Entry::getKey, e -> {
6767
Object annValue = e.getValue();
68-
if (annValue instanceof List<?> list) {
69-
annValue = List.copyOf(list);
68+
if (annValue instanceof ArrayList<?> list) {
69+
list.trimToSize();
7070
}
7171
return annValue;
7272
}))

0 commit comments

Comments
 (0)