class VelocityPlugin {
    private static final AgentLogger LOGGER = AgentLogger.getLogger(VelocityPlugin.class);

    @OnClassLoadEvent(classNameRegexp = "org.springframework.ui.velocity.VelocityEngineFactory")
    public static void patchSetPreferFileSystemAccess(ClassPool classPool, final CtClass ctClass) {<FILL_FUNCTION_BODY>}

    @OnClassLoadEvent(classNameRegexp = "org.springframework.ui.velocity.VelocityEngineFactory")
    public static void patchSetResourceLoaderPath(ClassPool classPool, final CtClass ctClass) {
        try {
            CtMethod method = ctClass.getDeclaredMethod("setResourceLoaderPath", new CtClass[]{classPool.get("java.lang.String")});
            method.insertAfter("this.resourceLoaderPath = \"classpath:/$$ha$velocity/,\" + this.resourceLoaderPath;");
        } catch (NotFoundException | CannotCompileException e) {
            LOGGER.debug("Cannot patch parseAndProcess method for {}", ctClass.getName(), e);
        }
    }

    @OnClassLoadEvent(classNameRegexp = "org.springframework.ui.velocity.VelocityEngineFactory")
    public static void patchInitSpringResourceLoader(ClassPool classPool, final CtClass ctClass) {
        try {
            CtMethod method = ctClass.getDeclaredMethod("initSpringResourceLoader", new CtClass[]{classPool.get("org.apache.velocity.app.VelocityEngine"),
                    classPool.get("java.lang.String")});
            method.insertAfter("$1.setProperty(\"spring.resource.loader.cache\", \"false\");");
        } catch (NotFoundException | CannotCompileException e) {
            LOGGER.debug("Cannot patch parseAndProcess method for {}", ctClass.getName(), e);
        }
    }
}

        try {
            CtMethod method = ctClass.getDeclaredMethod("setPreferFileSystemAccess", new CtClass[]{classPool.get("boolean")});
            method.insertAfter("this.preferFileSystemAccess = false;");
        } catch (NotFoundException | CannotCompileException e) {
            LOGGER.debug("Cannot patch parseAndProcess method for {}", ctClass.getName(), e);
        }
    
<no_super_class>