diff options
Diffstat (limited to 'sonar-batch-bootstrapper')
-rw-r--r-- | sonar-batch-bootstrapper/src/main/java/org/sonar/batch/bootstrapper/BootstrapClassLoader.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sonar-batch-bootstrapper/src/main/java/org/sonar/batch/bootstrapper/BootstrapClassLoader.java b/sonar-batch-bootstrapper/src/main/java/org/sonar/batch/bootstrapper/BootstrapClassLoader.java index 1bf933ea5c7..f0c678f9abd 100644 --- a/sonar-batch-bootstrapper/src/main/java/org/sonar/batch/bootstrapper/BootstrapClassLoader.java +++ b/sonar-batch-bootstrapper/src/main/java/org/sonar/batch/bootstrapper/BootstrapClassLoader.java @@ -19,8 +19,10 @@ */ package org.sonar.batch.bootstrapper; +import java.io.IOException; import java.net.URL; import java.net.URLClassLoader; +import java.util.Enumeration; /** * Special {@link URLClassLoader} to execute Sonar, which restricts loading from parent. @@ -90,4 +92,22 @@ public class BootstrapClassLoader extends URLClassLoader { return c; } + /** + * Unlike {@link URLClassLoader#getResource(String)} don't return resource from parent. + * See http://jira.codehaus.org/browse/SONAR-2276 + */ + @Override + public URL getResource(String name) { + return findResource(name); + } + + /** + * Unlike {@link URLClassLoader#getResources(String)} don't return resources from parent. + * See http://jira.codehaus.org/browse/SONAR-2276 + */ + @Override + public Enumeration<URL> getResources(String name) throws IOException { + return findResources(name); + } + } |