private static Constructor < ? > createImpl ( Class < ? > cl , ClassLoader loader ) { /** if (! Modifier.isAbstract(cl.getModifiers())) { throw new IllegalArgumentException(); } */ ClassGeneratorVault < ? > generator = new ClassGeneratorVault <> ( cl , loader ) ; Class < ? > proxyClass = generator . generate ( ) ; return proxyClass . getConstructors ( ) [ 0 ] ; }
Must return Constructor not MethodHandle because MethodHandles cache the type in the permgen .