public static Class<?> safeClassForName(ClassLoader classLoader, String className) {
        try {
            if (className.startsWith("com.sun.") || className.startsWith("com.apple.")) {
                return null;
            } else {
                return Class.forName(className, true, classLoader);
            }
        } catch (ClassNotFoundException | NoClassDefFoundError e) {
            return null;
        }
    }
Get the class for the given className via the given classLoader

@param classLoader classloader to be used
@param className fully qualified class name
@return {@code Class} instance matching the class name or null if not found
querydsl-codegen/src/main/java/com/querydsl/codegen/ClassPathUtils.java