@SuppressWarnings("unchecked") private <I> I instantiateImplementation(Class<?>[] constructorParameterTypes, String name, CompilationResult result, Object[] args) { try { Class<I> implementation = (Class<I>) result.getClassLoader().loadClass(name); Constructor<I> constructor = implementation.getConstructor(constructorParameterTypes); return constructor.newInstance(args); } catch (Exception e) { throw new RuntimeException(e); } }
try { blockingClass = result.getClassLoader().loadClass("org.jctools.queues.blocking."+model.blockingQueueClassName);