Do not convert ModFileScanData annotation values to immutable lists
Related: #627
This commit is contained in:
parent
f26d35070e
commit
4dcdf09a01
|
|
@ -8,7 +8,7 @@ import org.embeddedt.modernfix.ModernFix;
|
||||||
import org.objectweb.asm.Type;
|
import org.objectweb.asm.Type;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.List;
|
import java.util.ArrayList;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
@ -65,8 +65,8 @@ public class ModFileScanDataCompactor {
|
||||||
memberNames.addOrGet(a.memberName()),
|
memberNames.addOrGet(a.memberName()),
|
||||||
a.annotationData().entrySet().stream().collect(Collectors.toUnmodifiableMap(Map.Entry::getKey, e -> {
|
a.annotationData().entrySet().stream().collect(Collectors.toUnmodifiableMap(Map.Entry::getKey, e -> {
|
||||||
Object annValue = e.getValue();
|
Object annValue = e.getValue();
|
||||||
if (annValue instanceof List<?> list) {
|
if (annValue instanceof ArrayList<?> list) {
|
||||||
annValue = List.copyOf(list);
|
list.trimToSize();
|
||||||
}
|
}
|
||||||
return annValue;
|
return annValue;
|
||||||
}))
|
}))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user