Work around relocation of fastutil reflection call

This commit is contained in:
KennyTV 2020-11-23 20:49:28 +01:00
parent 9c0b187f31
commit 8de26a0ad3
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B

View File

@ -23,7 +23,9 @@ public class BlockConnectionStorage extends StoredObject {
static {
try {
fastUtilLongObjectHashMap = Class.forName("it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap").getConstructor();
//noinspection StringBufferReplaceableByString - prevent relocation
String className = new StringBuilder("it").append(".unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap").toString();
fastUtilLongObjectHashMap = Class.forName(className).getConstructor();
Via.getPlatform().getLogger().info("Using FastUtil Long2ObjectOpenHashMap for block connections");
} catch (ClassNotFoundException | NoSuchMethodException ignored) {
}