package net.md_5.bungee.event;

import sun.misc.Unsafe;

import java.lang.reflect.Field;

public class UnsafeUtils {
    private UnsafeUtils() {}

    private static final Unsafe UNSAFE;
    static {
        Unsafe unsafe;
        try {
            Class c = Class.forName("sun.misc.Unsafe");
            Field f = c.getField("theUnsafe");
            f.setAccessible(true);
            unsafe = (Unsafe) f.get(null);
        } catch (ClassNotFoundException | NoSuchFieldException | SecurityException e) {
            unsafe = null;
        } catch (IllegalAccessException e) {
            throw new AssertionError(e);
        }
        UNSAFE = unsafe;
    }

    public static boolean isUnsafeSupported() {
        return UNSAFE != null;
    }

    public static Unsafe getUnsafe() {
        return UNSAFE;
    }
}

@@ -313,16 +313,24 @@
  = c.get
+Declared
 Field(%22t

Use getDeclaredField to access Unsafe