logger.debug(String.format("[Compile Time] Janino: %dms, Bytecode load and parse: %dms, Class Merge: %dms, Subclass remap and load: %dms.", t1.elapsed(TimeUnit.MILLISECONDS), t2.elapsed(TimeUnit.MILLISECONDS), t3.elapsed(TimeUnit.MILLISECONDS), t4.elapsed(TimeUnit.MILLISECONDS)));
Class<?> c = classLoader.findClass(materializedClassName);
if (templateDefinition.getExternalInterface().isAssignableFrom(c)) {
return (T) c.newInstance();
} else {
throw new ClassTransformationException("The requested class did not implement the expected interface.");
}
} catch (CompileException | IOException | ClassNotFoundException | InstantiationException | IllegalAccessException e) {
throw new ClassTransformationException(String.format(
"Failure generating transformation classes for value: \n %s", entireClass), e);
}
}