mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
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
This commit is contained in:
parent
9d35004fff
commit
c65dc9063c
@ -50,6 +50,8 @@ public class ExtendedGroovyClassLoader extends GroovyClassLoader {
|
|||||||
|
|
||||||
private static final String SHARED_PACKAGE = "org.springframework.boot.groovy";
|
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 Map<String, byte[]> classResources = new HashMap<String, byte[]>();
|
||||||
|
|
||||||
private final GroovyCompilerScope scope;
|
private final GroovyCompilerScope scope;
|
||||||
@ -127,7 +129,14 @@ public class ExtendedGroovyClassLoader extends GroovyClassLoader {
|
|||||||
.doPrivileged(new PrivilegedAction<InnerLoader>() {
|
.doPrivileged(new PrivilegedAction<InnerLoader>() {
|
||||||
@Override
|
@Override
|
||||||
public InnerLoader run() {
|
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);
|
return new ExtendedClassCollector(loader, unit, su);
|
||||||
|
Loading…
Reference in New Issue
Block a user