Commit c65dc906 authored by Phillip Webb's avatar Phillip Webb

Don't expose URLs from InnerLoader

Update the CLI Groovy InnerLoader to not expose URLs. This prevents the
'TLD skipped' log messages from Tomcat that occurred previously due to
the InnerLoader and parent returning the same URLs.

Fixes gh-277
parent 9d35004f
......@@ -50,6 +50,8 @@ public class ExtendedGroovyClassLoader extends GroovyClassLoader {
private static final String SHARED_PACKAGE = "org.springframework.boot.groovy";
private static final URL[] NO_URLS = new URL[] {};
private final Map<String, byte[]> classResources = new HashMap<String, byte[]>();
private final GroovyCompilerScope scope;
......@@ -127,7 +129,14 @@ public class ExtendedGroovyClassLoader extends GroovyClassLoader {
.doPrivileged(new PrivilegedAction<InnerLoader>() {
@Override
public InnerLoader run() {
return new InnerLoader(ExtendedGroovyClassLoader.this);
return new InnerLoader(ExtendedGroovyClassLoader.this) {
// Don't return URLs from the inner loader so that Tomcat only
// searches the parent. Fixes 'TLD skipped' issues
@Override
public URL[] getURLs() {
return NO_URLS;
}
};
}
});
return new ExtendedClassCollector(loader, unit, su);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment