arkanovicz commented on code in PR #51: URL: https://github.com/apache/velocity-engine/pull/51#discussion_r1747264926
########## spring-velocity-support/src/main/java/org/apache/velocity/spring/VelocityEngineFactory.java: ########## @@ -259,41 +281,61 @@ protected VelocityEngine newVelocityEngine() throws IOException, VelocityExcepti */ protected void initVelocityResourceLoader(VelocityEngine velocityEngine, String resourceLoaderPath) { if (isPreferFileSystemAccess()) { + + // Only used with enhanced processing. + final List<String> filePaths = new ArrayList<>(); + final List<String> nonFilePaths = new ArrayList<>(); + + String[] paths = StringUtils.commaDelimitedListToStringArray(resourceLoaderPath); + // Try to load via the file system, fall back to SpringResourceLoader // (for hot detection of template changes, if possible). - try { - StringBuilder resolvedPath = new StringBuilder(); - String[] paths = StringUtils.commaDelimitedListToStringArray(resourceLoaderPath); - for (int i = 0; i < paths.length; i++) { - String path = paths[i]; + for (int i = 0; i < paths.length; i++) { + String path = paths[i]; + + // Don't check classpath: locations, they're not file-based. + // Some containers will expand jars and trigger false positives. + // If enhanced behavior isn't on, this will fall into the usual code it did before. + if (isSupportClasspathEnhancements() && path.startsWith(ResourceLoader.CLASSPATH_URL_PREFIX)) { Review Comment: I'm fine with dropping the flag and using the new behavior by default. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@velocity.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@velocity.apache.org For additional commands, e-mail: dev-h...@velocity.apache.org