From dad08cfa4639175b21abd4f300d7ebc95052ffd8 Mon Sep 17 00:00:00 2001 From: Jakob Herrmann Date: Thu, 6 Apr 2017 16:16:47 +0200 Subject: [PATCH] PackageCrawler latest version --- src/de/dhbwstuttgart/parser/PackageCrawler.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/de/dhbwstuttgart/parser/PackageCrawler.java b/src/de/dhbwstuttgart/parser/PackageCrawler.java index 18bcd444..7028c8e7 100644 --- a/src/de/dhbwstuttgart/parser/PackageCrawler.java +++ b/src/de/dhbwstuttgart/parser/PackageCrawler.java @@ -12,7 +12,7 @@ import java.util.LinkedList; import java.util.List; import java.util.ArrayList; import java.util.Set; - +import java.lang.InterruptedException; /** * Hilft beim Durchsuchen von Packages * Benutzt die Reflections-Library (https://github.com/ronmamo/reflections) @@ -20,10 +20,11 @@ import java.util.Set; */ public class PackageCrawler { - public static Set> getClassesInPackage(String packageName) { + public static Set> getClassesInPackage(String packageName){ List classLoadersList = new LinkedList(); - classLoadersList.add(ClasspathHelper.contextClassLoader()); + classLoadersList.add(Thread.currentThread().getContextClassLoader()); classLoadersList.add(ClasspathHelper.staticClassLoader()); + classLoadersList.add(Thread.currentThread().getContextClassLoader().getParent()); Reflections reflections = new Reflections(new ConfigurationBuilder() .setScanners(new SubTypesScanner(false /* don't exclude Object.class */), new ResourcesScanner())