From 605a65780a38da2e1e8e35c521876e68e5901cab Mon Sep 17 00:00:00 2001 From: dbarclay Date: Tue, 22 Sep 2015 18:04:45 -0700 Subject: [PATCH] DRILL-3822: Have PathScanner use own, not thread-context, class loader. --- .../java/org/apache/drill/common/util/PathScanner.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/common/src/main/java/org/apache/drill/common/util/PathScanner.java b/common/src/main/java/org/apache/drill/common/util/PathScanner.java index a44bdf2b47b..65bf9b5d8bd 100644 --- a/common/src/main/java/org/apache/drill/common/util/PathScanner.java +++ b/common/src/main/java/org/apache/drill/common/util/PathScanner.java @@ -130,9 +130,10 @@ public static Collection getConfigURLs() { * to scan for (relative to specified class loaders' classpath roots) * @param returnRootPathname whether to collect classpath root portion of * URL for each resource instead of full URL of each resource - * @param classLoaders set of class loaders in which to look up resource; - * none (empty array) to specify to use current thread's context - * class loader and {@link Reflections}'s class loader + * @param classLoaders not currently used (was: "set of class loaders in + * which to look up resource; none (empty array) to specify to use + * current thread's context class loader and {@link Reflections}'s + * class loader") * @returns ...; empty set if none */ public static Set forResource(final String resourcePathname, @@ -142,7 +143,7 @@ public static Set forResource(final String resourcePathname, resourcePathname); final Set resultUrlSet = Sets.newHashSet(); - final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); + final ClassLoader classLoader = PathScanner.class.getClassLoader(); try { final Enumeration resourceUrls = classLoader.getResources(resourcePathname);