diff options
author | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-03-21 13:59:56 +0300 |
---|---|---|
committer | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-03-30 01:26:57 +0400 |
commit | bea19bf7820ebfe7561f80ab250ccec07bb3538f (patch) | |
tree | 61b2074301c4651799f50e3e284825be1fe8f5a3 /sonar-batch-bootstrapper | |
parent | 8e7b3b00b4b9eace1f814a35c1b92a09818dbdf9 (diff) | |
download | sonarqube-bea19bf7820ebfe7561f80ab250ccec07bb3538f.tar.gz sonarqube-bea19bf7820ebfe7561f80ab250ccec07bb3538f.zip |
SONAR-2276 BootstrapClassLoader should not load resources from parent ClassLoader
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); + } + } |