docs: public static void makeClassLoaderMethodsAccessible() {
          // the AtomicBoolean make sure this gets invoked only once as WeldStartup is triggered per deployment
          if (classLoaderMethodsMadeAccessible.compareAndSet(false, true)) {
              try {
                  AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
                      public Object run() throws Exception {
                          Class<?> cl = Class.forName("java.lang.ClassLoader");
                          final String name = "defineClass";
  
                          defineClass1 = cl.getDeclaredMethod(name, String.class, byte[].class, int.class, int.class);
                          defineClass2 = cl.getDeclaredMethod(name, String.class, byte[].class, int.class, int.class, ProtectionDomain.class);
  
                          // First try with Unsafe to avoid illegal access
                          try {
                              // get Unsafe singleton instance
                              Field singleoneInstanceField = Unsafe.class.getDeclaredField("theUnsafe");
                              singleoneInstanceField.setAccessible(true);
                              Unsafe theUnsafe = (Unsafe) singleoneInstanceField.get(null);
  
                              // get the offset of the override field in AccessibleObject
                              long overrideOffset = theUnsafe.objectFieldOffset(AccessibleObject.class.getDeclaredField("override"));
  
                              // make both accessible
                              theUnsafe.putBoolean(defineClass1, overrideOffset, true);
                              theUnsafe.putBoolean(defineClass2, overrideOffset, true);
                              return null;
                          } catch (NoSuchFieldException e) {
                              // This is JDK 12+, the "override" field isn't there anymore, fallback to setAccessible()
                              defineClass1.setAccessible(true);
                              defineClass2.setAccessible(true);
                              return null;
                          }
                      }
                  });
              } catch (PrivilegedActionException pae) {
                  throw new RuntimeException("cannot initialize ClassPool", pae.getException());
              }
          }
      }